1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2025-05-01 14:49:00 +08:00

fix: 当用户访问一个当前用户没有的权限时导航区404

This commit is contained in:
leipu 2024-12-20 11:17:58 +08:00
commit 9a22ac1659
7 changed files with 1857 additions and 1192 deletions

View File

@ -19,6 +19,5 @@
"markdown",
"json",
"jsonc"
],
"common-intellisense.ui": ["naiveUi2"]
]
}

View File

@ -13,42 +13,42 @@
},
"dependencies": {
"@arco-design/color": "^0.4.0",
"@vueuse/core": "^11.1.0",
"axios": "^1.7.7",
"@vueuse/core": "^12.0.0",
"axios": "^1.7.9",
"dayjs": "^1.11.13",
"echarts": "^5.5.1",
"lodash-es": "^4.17.21",
"naive-ui": "^2.40.1",
"pinia": "^2.2.4",
"pinia-plugin-persistedstate": "^4.1.1",
"vue": "^3.5.12",
"naive-ui": "^2.40.3",
"pinia": "^2.3.0",
"pinia-plugin-persistedstate": "^4.1.3",
"vue": "^3.5.13",
"vue-echarts": "^7.0.3",
"vue-router": "^4.4.5",
"vue-router": "^4.5.0",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@antfu/eslint-config": "^3.8.0",
"@iconify/json": "^2.2.262",
"@unocss/eslint-config": "^0.63.6",
"@unocss/eslint-plugin": "^0.63.6",
"@unocss/preset-rem-to-px": "^0.63.6",
"@vitejs/plugin-vue": "^5.1.4",
"@vitejs/plugin-vue-jsx": "^4.0.1",
"eslint": "^9.13.0",
"eslint-plugin-format": "^0.1.2",
"@antfu/eslint-config": "^3.12.0",
"@iconify/json": "^2.2.282",
"@unocss/eslint-config": "^0.65.1",
"@unocss/eslint-plugin": "^0.65.1",
"@unocss/preset-rem-to-px": "^0.65.1",
"@vitejs/plugin-vue": "^5.2.1",
"@vitejs/plugin-vue-jsx": "^4.1.1",
"eslint": "^9.17.0",
"eslint-plugin-format": "^0.1.3",
"esno": "^4.8.0",
"fs-extra": "^11.2.0",
"glob": "^11.0.0",
"lint-staged": "^15.2.10",
"lint-staged": "^15.2.11",
"rollup-plugin-visualizer": "^5.12.0",
"simple-git-hooks": "^2.11.1",
"taze": "^0.17.2",
"unocss": "^0.63.6",
"unplugin-auto-import": "^0.18.3",
"unplugin-vue-components": "^0.27.4",
"vite": "^5.4.9",
"taze": "^0.18.0",
"unocss": "^0.65.1",
"unplugin-auto-import": "^0.19.0",
"unplugin-vue-components": "^0.27.5",
"vite": "^6.0.3",
"vite-plugin-router-warn": "^1.0.0",
"vite-plugin-vue-devtools": "^7.5.2",
"vite-plugin-vue-devtools": "^7.6.8",
"vue3-intro-step": "^1.0.5"
},
"simple-git-hooks": {

2978
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -12,16 +12,15 @@
<Vue3IntroStep
ref="myIntroStep"
v-model:show="show"
class="beginner-guide"
:config="config"
>
<template #prev="{ tipItem, index }">
<NButton type="primary" color="#fff" text-color="#fff" ghost round size="small" @click="prev(tipItem, index)">
<NButton class="mr-12" type="primary" color="#fff" text-color="#fff" ghost round size="small" @click="prev(tipItem, index)">
上一步
</NButton>
</template>
<template #next="{ tipItem }">
<NButton type="primary" color="#fff" text-color="#fff" ghost round size="small" @click="next(tipItem)">
<NButton class="mr-12" type="primary" color="#fff" text-color="#fff" ghost round size="small" @click="next(tipItem)">
下一步
</NButton>
</template>
@ -128,11 +127,3 @@ function prev() {
myIntroStep.value.prev()
}
</script>
<style lang="scss" scoped>
.beginner-guide {
.n-button {
margin-right: 12px;
}
}
</style>

View File

@ -43,6 +43,11 @@ export function createPermissionGuard(router) {
return { ...to, replace: true }
}
router.addRoute({
path: '/:catchAll(.*)',
redirect: '/404',
})
const routes = router.getRoutes()
if (routes.find(route => route.name === to.name))
return true

View File

@ -50,7 +50,7 @@ export const useAppStore = defineStore('app', {
},
},
persist: {
paths: ['collapsed', 'layout', 'primaryColor', 'naiveThemeOverrides'],
pick: ['collapsed', 'layout', 'primaryColor', 'naiveThemeOverrides'],
storage: sessionStorage,
},
})

View File

@ -88,7 +88,7 @@ export const useTabStore = defineStore('tab', {
},
},
persist: {
paths: ['tabs'],
pick: ['tabs'],
storage: sessionStorage,
},
})