Skip to content

Commit 39df9be

Browse files
author
puhui999
committed
fix: 修正合并代码后前端不能正常启动的问题
1 parent 0b06f36 commit 39df9be

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
"vite-plugin-purge-icons": "^0.9.2",
129129
"vite-plugin-svg-icons": "^2.0.1",
130130
"vite-plugin-top-level-await": "^1.3.1",
131+
"vue-eslint-parser": "^9.3.1",
131132
"vue-tsc": "^1.8.8"
132133
},
133134
"license": "MIT",

src/store/modules/permission.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { defineStore } from 'pinia'
22
import { store } from '../index'
33
import { cloneDeep } from 'lodash-es'
44
import remainingRouter from '@/router/modules/remaining'
5-
import { generateRoute, flatMultiLevelRoutes } from '@/utils/routerHelper'
5+
import { flatMultiLevelRoutes, generateRoute } from '@/utils/routerHelper'
66
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
77

88
const { wsCache } = useCache()
@@ -34,11 +34,11 @@ export const usePermissionStore = defineStore('permission', {
3434
async generateRoutes(): Promise<unknown> {
3535
return new Promise<void>(async (resolve) => {
3636
// 获得菜单列表,它在登录的时候,setUserInfoAction 方法中已经进行获取
37-
let res: AppCustomRouteRecordRaw[]
37+
let res: AppCustomRouteRecordRaw[] = []
3838
if (wsCache.get(CACHE_KEY.ROLE_ROUTERS)) {
3939
res = wsCache.get(CACHE_KEY.ROLE_ROUTERS) as AppCustomRouteRecordRaw[]
4040
}
41-
const routerMap: AppRouteRecordRaw[] = generateRoute(res as AppCustomRouteRecordRaw[])
41+
const routerMap: AppRouteRecordRaw[] = generateRoute(res)
4242
// 动态路由,404一定要放到最后面
4343
this.addRouters = routerMap.concat([
4444
{

0 commit comments

Comments
 (0)