refactor: 项目细节优化

This commit is contained in:
郝先瑞
2022-03-27 21:45:50 +08:00
parent 91e810ffa7
commit 0703579ecc
21 changed files with 87 additions and 314 deletions

View File

@@ -15,11 +15,7 @@ export * from './api/sms/advert'
export * from './api/oms/order'
export * from './api/ums/member'
export * from './store/user'
export * from './store/app'
export * from './store/permission'
export * from './store/setting'
export * from './store/tagsView'
export * from './store'
export * from './common'

57
src/types/store.d.ts vendored Normal file
View File

@@ -0,0 +1,57 @@
import {RouteRecordRaw,RouteLocationNormalized} 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 TagView extends Partial<RouteLocationNormalized> {
title?: string
}
export interface TagsViewState{
visitedViews: TagView[],
cachedViews: (string)[]
}
/**
* 用户状态类型声明
*/
export interface UserState {
token: string,
nickname: string,
avatar: string,
roles: string[],
perms: string[]
}

View File

@@ -1,12 +0,0 @@
/**
* 用户状态类型声明
*/
export interface AppState {
device: string,
sidebar: {
opened: boolean,
withoutAnimation: boolean
},
language:string,
size:string
}

View File

@@ -1,9 +0,0 @@
import {RouteRecordRaw} from "vue-router";
/**
* 权限类型声明
*/
export interface PermissionState{
routes:RouteRecordRaw[]
addRoutes: RouteRecordRaw[]
}

View File

@@ -1,10 +0,0 @@
/**
* 设置状态类型声明
*/
export interface SettingState {
theme: string,
tagsView: boolean,
fixedHeader: boolean,
showSettings: boolean,
sidebarLogo: boolean
}

View File

@@ -1,12 +0,0 @@
import {RouteLocationNormalized} from "vue-router";
/**
* 用户状态类型声明
*/
export interface TagView extends Partial<RouteLocationNormalized> {
title?: string
}
export interface TagsViewState{
visitedViews: TagView[],
cachedViews: (string)[]
}

View File

@@ -1,10 +0,0 @@
/**
* 用户状态类型声明
*/
export interface UserState {
token: string,
nickname: string,
avatar: string,
roles: string[],
perms: string[]
}