diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index 282422ad..f04320ee 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -53,7 +53,7 @@ export const usePermissionStore = defineStore('permission', () => { const routes = ref([]); const addRoutes = ref([]); - // auctions + // actions function setRoutes(newRoutes: RouteRecordRaw[]) { addRoutes.value = newRoutes; routes.value = constantRoutes.concat(newRoutes); diff --git a/src/store/modules/settings.ts b/src/store/modules/settings.ts index e25c507c..16193f17 100644 --- a/src/store/modules/settings.ts +++ b/src/store/modules/settings.ts @@ -19,7 +19,7 @@ export const useSettingsStore = defineStore('setting', () => { const fixedHeader = ref(defaultSettings.fixedHeader); const sidebarLogo = ref(defaultSettings.sidebarLogo); - // auction + // actions function changeSetting(param: { key: string; value: any }) { const { key, value } = param; switch (key) { diff --git a/src/store/modules/tagsView.ts b/src/store/modules/tagsView.ts index f304744f..f8a69a23 100644 --- a/src/store/modules/tagsView.ts +++ b/src/store/modules/tagsView.ts @@ -12,7 +12,7 @@ export const useTagsViewStore = defineStore('tagsView', () => { const visitedViews = ref([]); const cachedViews = ref([]); - // auctions + // actions function addVisitedView(view: TagView) { if (visitedViews.value.some(v => v.path === view.path)) return; if (view.meta && view.meta.affix) { diff --git a/src/store/modules/types.ts b/src/store/modules/types.ts deleted file mode 100644 index a03d4cc9..00000000 --- a/src/store/modules/types.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { RouteLocationNormalized, RouteRecordRaw } from 'vue-router'; - -export interface AppState { - device: string; - sidebar: { - opened: boolean; - withoutAnimation: boolean; - }; - language: string; - size: string; -} - -export interface PermissionState { - routes: RouteRecordRaw[]; - addRoutes: RouteRecordRaw[]; -} - -export interface SettingState { - theme: string; - tagsView: boolean; - fixedHeader: boolean; - showSettings: boolean; - sidebarLogo: boolean; -} - -export interface UserState { - token: string; - nickname: string; - avatar: string; - roles: string[]; - perms: string[]; -} - -export interface TagView extends Partial { - title?: string; -} - -export interface TagsViewState { - visitedViews: TagView[]; - cachedViews: string[]; -} diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index f436d5fc..60ce7caa 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -17,7 +17,7 @@ export const useUserStore = defineStore('user', () => { const roles = ref>([]); // 用户角色编码集合 → 判断路由权限 const perms = ref>([]); // 用户权限编码集合 → 判断按钮权限 - // auctions + // actions // 登录 function login(loginData: LoginData) {