|
@@ -138,12 +138,15 @@ export const useUserStore = defineStore({
|
|
},
|
|
},
|
|
async getUserInfoAction(): Promise<UserInfo | null> {
|
|
async getUserInfoAction(): Promise<UserInfo | null> {
|
|
//添加平台权限
|
|
//添加平台权限
|
|
- const qxjy = await this.getUrlParams2();
|
|
|
|
- if (!qxjy) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
if (!this.getToken) return null;
|
|
if (!this.getToken) return null;
|
|
const userInfo = await getUserInfo();
|
|
const userInfo = await getUserInfo();
|
|
|
|
+ const appStore = useAppStoreWithOut();
|
|
|
|
+ userInfo.platformName && appStore.setTitle(userInfo.platformName);
|
|
|
|
+ // const qxjy = await this.getUrlParams2(userInfo);
|
|
|
|
+ // console.log('qxjy', qxjy);
|
|
|
|
+ // if (!qxjy) {
|
|
|
|
+ // return;
|
|
|
|
+ // }
|
|
const { roleId } = userInfo;
|
|
const { roleId } = userInfo;
|
|
if (isArray(roleId)) {
|
|
if (isArray(roleId)) {
|
|
const roleList = roleId.map((item) => item.value) as RoleEnum[];
|
|
const roleList = roleId.map((item) => item.value) as RoleEnum[];
|
|
@@ -190,38 +193,38 @@ export const useUserStore = defineStore({
|
|
},
|
|
},
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- async getUrlParams2() {
|
|
|
|
|
|
+ async getUrlParams2(res) {
|
|
const { createConfirm } = useMessage();
|
|
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;
|
|
|
|
|
|
+ // 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;
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|
|
});
|