refactor(store): 移除模块前缀
This commit is contained in:
@@ -4,7 +4,7 @@ import { store } from "@/store";
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
export const useAppStore = defineStore({
|
||||
id: "youlai-app",
|
||||
id: "app",
|
||||
state: ():AppState=>({
|
||||
device: 'desktop',
|
||||
sidebar: {
|
||||
|
||||
@@ -46,7 +46,7 @@ export const filterAsyncRoutes = (routes: RouteRecordRaw[], roles: string[]) =>
|
||||
|
||||
|
||||
export const usePermissionStore = defineStore({
|
||||
id:"youlai-permission",
|
||||
id:"permission",
|
||||
state:():PermissionState=>( {
|
||||
routes: [],
|
||||
addRoutes: []
|
||||
|
||||
@@ -6,7 +6,7 @@ import defaultSettings from '../../settings'
|
||||
const {showSettings, tagsView, fixedHeader, sidebarLogo} = defaultSettings
|
||||
|
||||
export const useSettingStore = defineStore({
|
||||
id: "pure-setting",
|
||||
id: "setting",
|
||||
state:():SettingState =>({
|
||||
theme: '',
|
||||
showSettings: showSettings,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { store } from "@/store";
|
||||
import {TagsViewState} from "@store/interface";
|
||||
|
||||
const tagsViewStore=defineStore({
|
||||
id:"youlai-tagsView",
|
||||
id:"tagsView",
|
||||
state:():TagsViewState=>( {
|
||||
visitedViews: [],
|
||||
cachedViews: []
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { store } from "@/store";
|
||||
import {UserState, RootStateTypes} from "@store/interface";
|
||||
import {UserState} from "@store/interface";
|
||||
import {Local} from "@utils/storage";
|
||||
import {getUserInfo, login, logout} from "@api/login";
|
||||
import {resetRouter} from "@router";
|
||||
@@ -17,7 +17,7 @@ const getDefaultState = () => {
|
||||
}
|
||||
|
||||
export const useUserStore = defineStore({
|
||||
id:"youlai-user",
|
||||
id:"user",
|
||||
state: ():UserState=>({
|
||||
token: Local.get('token') || '',
|
||||
nickname: '',
|
||||
|
||||
Reference in New Issue
Block a user