|
@@ -347,38 +347,57 @@ export default {
|
|
|
this.$refs.passForm.resetFields();
|
|
|
},
|
|
|
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) {
|
|
|
+ var schoolCode = window.location.hostname.split(".")[0];
|
|
|
+ this.$http
|
|
|
+ .get("https://auth.exam-cloud.cn/api/open/auth/logout/" + schoolCode)
|
|
|
+ .then(() => {
|
|
|
+ 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(),
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
};
|