fix(测试计划): 修复测试计划报告无痕浏览器打开重定向登录页面

This commit is contained in:
xinxin.wu 2024-06-19 19:02:53 +08:00 committed by Craftsman
parent 64a2cb00d9
commit bf515c0802
3 changed files with 31 additions and 21 deletions

View File

@ -81,7 +81,10 @@
}
const { height } = useWindowSize();
appStore.innerHeight = height.value;
if (userStore.id) {
userStore.initLocalConfig(); //
}
// @desc: TODO便
appStore.getProjectInfos();
});

View File

@ -302,6 +302,9 @@
onBeforeMount(async () => {
try {
loading.value = true;
if (!userStore.id) {
return;
}
const res = await getLocalConfig();
if (Array.isArray(res)) {
res.forEach((config) => {

View File

@ -114,7 +114,9 @@ const useUserStore = defineStore('user', {
appStore.setCurrentOrgId(res.lastOrganizationId || '');
appStore.setCurrentProjectId(res.lastProjectId || '');
this.setInfo(res);
if (res) {
this.initLocalConfig(); // 获取本地执行配置
}
} catch (err) {
clearToken();
throw err;
@ -129,7 +131,9 @@ const useUserStore = defineStore('user', {
appStore.setCurrentOrgId(res.lastOrganizationId || '');
appStore.setCurrentProjectId(res.lastProjectId || '');
this.setInfo(res);
if (res) {
this.initLocalConfig(); // 获取本地执行配置
}
} catch (err) {
clearToken();
throw err;
@ -207,24 +211,24 @@ const useUserStore = defineStore('user', {
},
// 获取本地执行配置
async initLocalConfig() {
try {
const res = await getLocalConfig();
if (res) {
const apiLocalExec = res.find((e) => e.type === 'API');
if (apiLocalExec && apiLocalExec.userUrl) {
this.hasLocalExec = true;
this.isPriorityLocalExec = apiLocalExec.enable || false;
this.localExecuteUrl = apiLocalExec.userUrl || '';
} else {
this.hasLocalExec = false;
this.isPriorityLocalExec = false;
this.localExecuteUrl = '';
}
}
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);
}
// try {
// const res = await getLocalConfig();
// if (res) {
// const apiLocalExec = res.find((e) => e.type === 'API');
// if (apiLocalExec && apiLocalExec.userUrl) {
// this.hasLocalExec = true;
// this.isPriorityLocalExec = apiLocalExec.enable || false;
// this.localExecuteUrl = apiLocalExec.userUrl || '';
// } else {
// this.hasLocalExec = false;
// this.isPriorityLocalExec = false;
// this.localExecuteUrl = '';
// }
// }
// } catch (error) {
// // eslint-disable-next-line no-console
// console.log(error);
// }
},
async checkIsLogin(forceSet = false) {
const { isLoginPage } = useUser();