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(); const { height } = useWindowSize();
appStore.innerHeight = height.value; appStore.innerHeight = height.value;
if (userStore.id) {
userStore.initLocalConfig(); // userStore.initLocalConfig(); //
}
// @desc: TODO便 // @desc: TODO便
appStore.getProjectInfos(); appStore.getProjectInfos();
}); });

View File

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

View File

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