fix(全局): 无项目资源权限判定调整
This commit is contained in:
parent
2f7ac16d86
commit
0102299f09
|
@ -270,13 +270,13 @@ const useAppStore = defineStore('app', {
|
||||||
},
|
},
|
||||||
async getProjectInfos() {
|
async getProjectInfos() {
|
||||||
try {
|
try {
|
||||||
if (!this.currentProjectId) {
|
const routeName = router.currentRoute.value.name as string;
|
||||||
|
if (!this.currentProjectId || routeName?.includes('setting')) {
|
||||||
|
// 如果没有项目id,或访问的是系统设置下的页面,则不读取项目基础信息
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const res = await getProjectInfo(this.currentProjectId);
|
const res = await getProjectInfo(this.currentProjectId);
|
||||||
const routeName = router.currentRoute.value.name as string;
|
if (!res || res.deleted) {
|
||||||
if ((!res || res.deleted) && !routeName?.includes('setting')) {
|
|
||||||
// 如果没有项目信息,且访问的不是系统设置下的页面,则跳转到无项目页面
|
|
||||||
router.push({
|
router.push({
|
||||||
name: NO_PROJECT_ROUTE_NAME,
|
name: NO_PROJECT_ROUTE_NAME,
|
||||||
});
|
});
|
||||||
|
|
|
@ -255,6 +255,12 @@ const useUserStore = defineStore('user', {
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const routeName = router.currentRoute.value.name as string;
|
||||||
|
if (routeName?.includes('setting')) {
|
||||||
|
// 访问系统设置下的页面,不需要获取项目信息,会在切换到非系统设置页面时获取(ms-menu组件内初始化会获取)
|
||||||
|
appStore.setCurrentMenuConfig([]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
const res = await getProjectInfo(appStore.currentProjectId);
|
const res = await getProjectInfo(appStore.currentProjectId);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
// 如果项目被删除或者被禁用,跳转到无项目页面
|
// 如果项目被删除或者被禁用,跳转到无项目页面
|
||||||
|
|
Loading…
Reference in New Issue