2
0

fix: 静态路由角色拦截限制

This commit is contained in:
TsMask
2024-12-02 16:20:03 +08:00
parent 5e54aaf24d
commit 3f01adb2ad
7 changed files with 78 additions and 118 deletions

View File

@@ -31,13 +31,6 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
}
);
/** is super role in static route */
const isStaticSuper = computed(() => {
const { VITE_AUTH_ROUTE_MODE, VITE_STATIC_SUPER_ROLE } = import.meta.env;
return VITE_AUTH_ROUTE_MODE === 'static' && userInfo.roles?.includes(VITE_STATIC_SUPER_ROLE);
});
/** Is login */
const isLogin = computed(() => Boolean(token.value));
@@ -160,7 +153,6 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
return {
token,
userInfo,
isStaticSuper,
isLogin,
loginLoading,
resetStore,