|
@@ -347,38 +347,61 @@ export default {
|
|
this.$refs.passForm.resetFields();
|
|
this.$refs.passForm.resetFields();
|
|
},
|
|
},
|
|
logout() {
|
|
logout() {
|
|
- const orgId = this.user.rootOrgId;
|
|
|
|
- const getRootOrgId = () => {
|
|
|
|
- if (location.hostname.includes("qmth.com.cn")) {
|
|
|
|
- return "";
|
|
|
|
- } else {
|
|
|
|
- return "?orgId=" + orgId;
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- this.$http
|
|
|
|
- .post(CORE_API + "/auth/logout")
|
|
|
|
- .then(() => {
|
|
|
|
- this.USER_SIGNOUT();
|
|
|
|
- window.name = "";
|
|
|
|
- this.$router.replace({
|
|
|
|
- path: "/login" + getRootOrgId(),
|
|
|
|
|
|
+ if ("cas" == this.user.from) {
|
|
|
|
+ this.$http
|
|
|
|
+ .get("/api/auth/logout/" + this.user.scode)
|
|
|
|
+ .then((response) => {
|
|
|
|
+ const link = document.createElement("a");
|
|
|
|
+ link.href = response.data.url;
|
|
|
|
+ link.rel = "noopener noreferrer";
|
|
|
|
+ document.body.appendChild(link);
|
|
|
|
+ link.click();
|
|
|
|
+ this.USER_SIGNOUT();
|
|
|
|
+ })
|
|
|
|
+ .catch((response) => {
|
|
|
|
+ if (response.status == 500) {
|
|
|
|
+ this.$notify({
|
|
|
|
+ showClose: true,
|
|
|
|
+ message: response.data.desc,
|
|
|
|
+ type: "error",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ this.USER_SIGNOUT();
|
|
});
|
|
});
|
|
- })
|
|
|
|
- .catch((response) => {
|
|
|
|
- if (response.status == 500) {
|
|
|
|
- this.$notify({
|
|
|
|
- showClose: true,
|
|
|
|
- message: response.data.desc,
|
|
|
|
- type: "error",
|
|
|
|
- });
|
|
|
|
|
|
+ } else {
|
|
|
|
+ const orgId = this.user.rootOrgId;
|
|
|
|
+ const getRootOrgId = () => {
|
|
|
|
+ if (location.hostname.includes("qmth.com.cn")) {
|
|
|
|
+ return "";
|
|
|
|
+ } else {
|
|
|
|
+ return "?orgId=" + orgId;
|
|
}
|
|
}
|
|
- this.USER_SIGNOUT();
|
|
|
|
- window.name = "";
|
|
|
|
- this.$router.replace({
|
|
|
|
- path: "/login" + getRootOrgId(),
|
|
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ this.$http
|
|
|
|
+ .post(CORE_API + "/auth/logout")
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.USER_SIGNOUT();
|
|
|
|
+ window.name = "";
|
|
|
|
+ this.$router.replace({
|
|
|
|
+ path: "/login" + getRootOrgId(),
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ .catch((response) => {
|
|
|
|
+ if (response.status == 500) {
|
|
|
|
+ this.$notify({
|
|
|
|
+ showClose: true,
|
|
|
|
+ message: response.data.desc,
|
|
|
|
+ type: "error",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ this.USER_SIGNOUT();
|
|
|
|
+ window.name = "";
|
|
|
|
+ this.$router.replace({
|
|
|
|
+ path: "/login" + getRootOrgId(),
|
|
|
|
+ });
|
|
});
|
|
});
|
|
- });
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|