Skip to content

Commit

Permalink
修复后端返回路由时,因为父级auth为空字符串或数组导致子级权限失效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hooray committed Mar 19, 2024
1 parent 10fae3f commit f48ebec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/store/modules/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const useRouteStore = defineStore(
routes.forEach((route) => {
if (route.children) {
const childrenBaseUrl = resolveRoutePath(baseUrl, route.path)
const childrenBaseAuth = baseAuth ?? route.meta?.auth
const childrenBaseAuth = !baseAuth || baseAuth === '' || baseAuth?.length === 0 ? route.meta?.auth : baseAuth
const tmpBreadcrumb = cloneDeep(breadcrumb)
tmpBreadcrumb.push({
path: childrenBaseUrl,
Expand Down Expand Up @@ -82,7 +82,7 @@ const useRouteStore = defineStore(
if (!tmpRoute.meta) {
tmpRoute.meta = {}
}
tmpRoute.meta.auth = baseAuth ?? tmpRoute.meta?.auth
tmpRoute.meta.auth = !baseAuth || baseAuth === '' || baseAuth?.length === 0 ? tmpRoute.meta?.auth : baseAuth
tmpRoute.meta.breadcrumbNeste = tmpBreadcrumb
res.push(tmpRoute)
}
Expand Down

0 comments on commit f48ebec

Please sign in to comment.