diff --git a/src/layouts/components/LayoutSideNav.vue b/src/layouts/components/LayoutSideNav.vue index 1a6fb67..771408f 100644 --- a/src/layouts/components/LayoutSideNav.vue +++ b/src/layouts/components/LayoutSideNav.vue @@ -5,7 +5,7 @@ :layout="settingStore.layout" :is-fixed="settingStore.isSidebarFixed" :menu="sideMenu" - :theme="settingStore.mode" + :theme="settingStore.displayMode" :is-compact="settingStore.isSidebarCompact" /> diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index fba0728..575af0f 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,6 +1,6 @@ import { defineStore } from 'pinia'; import { TOKEN_NAME } from '@/config/global'; -import { store, usePermissionStore } from '@/store'; +import { store } from '@/store'; const InitUserInfo = { roles: [], @@ -79,12 +79,6 @@ export const useUserStore = defineStore('user', { this.token = ''; }, }, - persist: { - afterRestore: (ctx) => { - const permissionStore = usePermissionStore(); - permissionStore.initRoutes(ctx.store.roles); - }, - }, }); export function getUserStore() { diff --git a/src/utils/request/index.ts b/src/utils/request/index.ts index 3a34fe6..7d15c7e 100644 --- a/src/utils/request/index.ts +++ b/src/utils/request/index.ts @@ -57,7 +57,7 @@ const transform: AxiosTransform = { const { apiUrl, isJoinPrefix, urlPrefix, joinParamsToUrl, formatDate, joinTime = true } = options; // 添加接口前缀 - if (isJoinPrefix) { + if (isJoinPrefix && urlPrefix && isString(urlPrefix)) { config.url = `${urlPrefix}${config.url}`; }