|
@@ -12,10 +12,12 @@ import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
import { router } from '/@/router';
|
|
|
import { usePermissionStore } from '/@/store/modules/permission';
|
|
|
+import { useAppStoreWithOut } from '/@/store/modules/app';
|
|
|
import { RouteRecordRaw } from 'vue-router';
|
|
|
import { PAGE_NOT_FOUND_ROUTE } from '/@/router/routes/basic';
|
|
|
import { isArray } from '/@/utils/is';
|
|
|
import { h } from 'vue';
|
|
|
+import { addressKey } from '/@/api/jyUserPlatform/index';
|
|
|
|
|
|
interface UserState {
|
|
|
userInfo: Nullable<UserInfo>;
|
|
@@ -135,6 +137,11 @@ export const useUserStore = defineStore({
|
|
|
return userInfo;
|
|
|
},
|
|
|
async getUserInfoAction(): Promise<UserInfo | null> {
|
|
|
+ //添加平台权限
|
|
|
+ const qxjy = await this.getUrlParams2();
|
|
|
+ if (!qxjy) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (!this.getToken) return null;
|
|
|
const userInfo = await getUserInfo();
|
|
|
const { roleId } = userInfo;
|
|
@@ -183,6 +190,39 @@ export const useUserStore = defineStore({
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
+ async getUrlParams2() {
|
|
|
+ const { createConfirm } = useMessage();
|
|
|
+ const url = window.location.href;
|
|
|
+ const urlStr = url.split('?')[1];
|
|
|
+ const urlSearchParams = new URLSearchParams(urlStr);
|
|
|
+ const result = Object.fromEntries(urlSearchParams.entries());
|
|
|
+ const address = result['key'];
|
|
|
+ if (address) {
|
|
|
+ const res = await addressKey(address);
|
|
|
+ console.log('addressKey', res);
|
|
|
+ const appStore = useAppStoreWithOut();
|
|
|
+ appStore.setTitle(res.platformName);
|
|
|
+ if (res.status == 1) {
|
|
|
+ createConfirm({
|
|
|
+ iconType: 'warning',
|
|
|
+ title: '警告',
|
|
|
+ content: `此平台已被禁用`,
|
|
|
+ onOk: async () => {
|
|
|
+ window.opener = null;
|
|
|
+ window.open('about:blank', '_top')?.close();
|
|
|
+ },
|
|
|
+ onCancel: async () => {
|
|
|
+ window.opener = null;
|
|
|
+ window.open('about:blank', '_top')?.close();
|
|
|
+ },
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
});
|
|
|
|