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

This reverts commit bf515c0802.
This commit is contained in:
fit2-zhao 2024-06-19 19:20:48 +08:00 committed by Craftsman
parent bf515c0802
commit 3096cc9c95
3 changed files with 21 additions and 31 deletions

View File

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

View File

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

View File

@ -114,9 +114,7 @@ const useUserStore = defineStore('user', {
appStore.setCurrentOrgId(res.lastOrganizationId || '');
appStore.setCurrentProjectId(res.lastProjectId || '');
this.setInfo(res);
if (res) {
this.initLocalConfig(); // 获取本地执行配置
}
this.initLocalConfig(); // 获取本地执行配置
} catch (err) {
clearToken();
throw err;
@ -131,9 +129,7 @@ const useUserStore = defineStore('user', {
appStore.setCurrentOrgId(res.lastOrganizationId || '');
appStore.setCurrentProjectId(res.lastProjectId || '');
this.setInfo(res);
if (res) {
this.initLocalConfig(); // 获取本地执行配置
}
this.initLocalConfig(); // 获取本地执行配置
} catch (err) {
clearToken();
throw err;
@ -211,24 +207,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();