From d438b525b2839fcc5e281a5c4d3c7ed8cc294e01 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Wed, 4 Dec 2024 17:19:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=8F=9C=E5=8D=95=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=E9=A1=B6=E9=83=A8=EF=BC=8C=E8=B7=AF=E7=94=B1=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/business/auth.ts | 4 +- src/layouts/modules/global-header/index.vue | 5 +- src/store/modules/auth/shared.ts | 1 - src/theme/settings.ts | 25 +++------ src/typings/api.d.ts | 1 - src/views/function/toggle-auth/index.vue | 61 +-------------------- 6 files changed, 15 insertions(+), 82 deletions(-) diff --git a/src/hooks/business/auth.ts b/src/hooks/business/auth.ts index d324223..9baeb0b 100644 --- a/src/hooks/business/auth.ts +++ b/src/hooks/business/auth.ts @@ -9,10 +9,10 @@ export function useAuth() { } if (typeof codes === 'string') { - return authStore.userInfo.buttons.includes(codes); + return authStore.userInfo.permissions.includes(codes); } - return codes.some(code => authStore.userInfo.buttons.includes(code)); + return codes.some(code => authStore.userInfo.permissions.includes(code)); } function hasRole(role: string | string[]) { diff --git a/src/layouts/modules/global-header/index.vue b/src/layouts/modules/global-header/index.vue index 3a1c753..3fe324e 100644 --- a/src/layouts/modules/global-header/index.vue +++ b/src/layouts/modules/global-header/index.vue @@ -57,14 +57,15 @@ const headerMenus = computed(() => {
- + - +
diff --git a/src/store/modules/auth/shared.ts b/src/store/modules/auth/shared.ts index bc0ab24..917b208 100644 --- a/src/store/modules/auth/shared.ts +++ b/src/store/modules/auth/shared.ts @@ -7,7 +7,6 @@ export function getToken() { export const emptyInfo: Api.Auth.UserInfo = { roles: [], - buttons: [], permissions: [], user: null }; diff --git a/src/theme/settings.ts b/src/theme/settings.ts index fe659f6..9bae966 100644 --- a/src/theme/settings.ts +++ b/src/theme/settings.ts @@ -1,23 +1,16 @@ /** Default theme settings */ export const themeSettings: App.Theme.ThemeSetting = { - themeScheme: 'light', - themeColor: '#646cff', - otherColor: { info: '#2080f0', success: '#52c41a', warning: '#faad14', error: '#f5222d' }, + themeScheme: "light", + themeColor: "#06B6D4", + otherColor: {info: "#06B6D4", success: "#52c41a", warning: "#faad14", error: "#f5222d"}, isInfoFollowPrimary: true, - layout: { mode: 'horizontal-mix', scrollMode: 'content' }, - page: { animate: true, animateMode: 'fade-slide' }, - header: { height: 56, breadcrumb: { visible: true, showIcon: true } }, - tab: { visible: false, cache: true, height: 44, mode: 'chrome' }, + layout: {mode: "horizontal", scrollMode: "content"}, + page: {animate: true, animateMode: "fade-slide"}, + header: {height: 56, breadcrumb: {visible: true, showIcon: true}}, + tab: {visible: false, cache: true, height: 44, mode: "chrome"}, fixedHeaderAndTab: true, - sider: { - inverted: false, - width: 220, - collapsedWidth: 64, - mixWidth: 90, - mixCollapsedWidth: 64, - mixChildMenuWidth: 200 - }, - footer: { visible: true, fixed: false, height: 36, right: true } + sider: {inverted: false, width: 220, collapsedWidth: 64, mixWidth: 90, mixCollapsedWidth: 64, mixChildMenuWidth: 200}, + footer: {visible: true, fixed: false, height: 36, right: true} }; /** diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index 2aa40fe..99554e0 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -81,7 +81,6 @@ declare namespace Api { interface UserInfo { user: User | null; roles: string[]; - buttons: string[]; /** permissions */ permissions: string[]; } diff --git a/src/views/function/toggle-auth/index.vue b/src/views/function/toggle-auth/index.vue index a66c85b..cdb966a 100644 --- a/src/views/function/toggle-auth/index.vue +++ b/src/views/function/toggle-auth/index.vue @@ -1,56 +1,10 @@