refactor(通用功能): 调整跳转时参数值的设置
This commit is contained in:
parent
3518c37ffb
commit
fe852441a1
|
@ -155,8 +155,18 @@ const useUserStore = defineStore('user', {
|
|||
setToken(res.sessionId, res.csrfToken);
|
||||
this.setInfo(res);
|
||||
const { orgId, pId } = getHashParameters();
|
||||
appStore.setCurrentOrgId(forceSet ? res.lastOrganizationId || '' : orgId || '');
|
||||
appStore.setCurrentProjectId(forceSet ? res.lastProjectId || '' : pId || '');
|
||||
// 1. forceSet是强制设置,需要设置res的,2.非force且地址栏有,则也设置 3.地址栏参数为空就不设置
|
||||
// 如果访问页面的时候携带了组织 ID和项目 ID,则不设置
|
||||
if (!forceSet && orgId) {
|
||||
appStore.setCurrentOrgId(orgId);
|
||||
}
|
||||
if (!forceSet && pId) {
|
||||
appStore.setCurrentProjectId(pId);
|
||||
}
|
||||
if (forceSet) {
|
||||
appStore.setCurrentOrgId(res.lastOrganizationId || '');
|
||||
appStore.setCurrentProjectId(res.lastProjectId || '');
|
||||
}
|
||||
return true;
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
|
|
Loading…
Reference in New Issue