|
@@ -121,6 +121,8 @@ import localMenus from "@/constants/menus-data";
|
|
|
import { sysMenu, logout } from "@/modules/login/api";
|
|
|
import ResetPwd from "../modules/base/components/ResetPwd";
|
|
|
import { SYS_ADMIN_NAME } from "@/constants/enumerate";
|
|
|
+import { getAuthInfo } from "../plugins/auth";
|
|
|
+import { autoSubmitForm } from "../plugins/utils";
|
|
|
|
|
|
const MENU_ICONS = {
|
|
|
base: "base",
|
|
@@ -133,7 +135,12 @@ export default {
|
|
|
name: "home",
|
|
|
components: { ResetPwd },
|
|
|
data() {
|
|
|
- const user = this.$ls.get("user", { id: "", realName: "", roleList: [] });
|
|
|
+ const user = this.$ls.get("user", {
|
|
|
+ id: "",
|
|
|
+ realName: "",
|
|
|
+ roleList: [],
|
|
|
+ appSource: ""
|
|
|
+ });
|
|
|
const IS_SUPER_ADMIN = user.loginName === SYS_ADMIN_NAME;
|
|
|
|
|
|
return {
|
|
@@ -147,6 +154,7 @@ export default {
|
|
|
validRoutes: [],
|
|
|
username: user.realName,
|
|
|
userRoles: user.roleList,
|
|
|
+ appSource: user.appSource,
|
|
|
schoolLogo: this.$ls.get("schoolLogo"),
|
|
|
schoolName: this.$ls.get("schoolName"),
|
|
|
userInfo: {
|
|
@@ -331,9 +339,30 @@ export default {
|
|
|
.catch(() => {});
|
|
|
},
|
|
|
async logoutAction() {
|
|
|
- await logout();
|
|
|
- this.$ls.clear();
|
|
|
- this.$router.push({ name: "Login" });
|
|
|
+ if (this.appSource === "SYSTEM") {
|
|
|
+ await logout();
|
|
|
+ this.$ls.clear();
|
|
|
+ this.$router.push({ name: "Login" });
|
|
|
+ } else if (this.appSource === "WHU_THIRD") {
|
|
|
+ window.location.href =
|
|
|
+ "/api/report/wuda/open/user/authentication/logout";
|
|
|
+ } else if (this.appSource === "PRINT_THIRD") {
|
|
|
+ const url = "/api/report/sso/user/authentication/logout";
|
|
|
+ const infos = getAuthInfo({
|
|
|
+ sessionId: this.$ls.get("user", { sessionId: "" }).sessionId,
|
|
|
+ token: this.$ls.get("token"),
|
|
|
+ url,
|
|
|
+ method: "post"
|
|
|
+ });
|
|
|
+ autoSubmitForm(url, {
|
|
|
+ ...infos,
|
|
|
+ orgId: this.$ls.get("orgId", ""),
|
|
|
+ schoolId: this.$ls.get("schoolId", ""),
|
|
|
+ userId: this.$ls.get("user", { id: "" }).id
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message.error("未知来源");
|
|
|
+ }
|
|
|
},
|
|
|
toSelectSchool() {
|
|
|
if (this.IS_SUPER_ADMIN) this.$router.push({ name: "SelectSchool" });
|