* fix(web): 修复默认不存在时跳转问题

* feature(web): 图片组件增加预览
This commit is contained in:
Rhon Joe
2023-07-14 21:21:25 +08:00
committed by GitHub
parent 784dca2baa
commit fe27fd4c86
4 changed files with 24 additions and 5 deletions
+7 -1
View File
@@ -65,7 +65,13 @@ export const useUserStore = defineStore('user', () => {
asyncRouters.forEach(asyncRouter => {
router.addRoute(asyncRouter)
})
await router.replace({ name: userInfo.value.authority.defaultRouter })
if (!router.hasRoute(userInfo.value.authority.defaultRouter)) {
ElMessage.error("请联系管理员进行授权")
} else {
await router.replace({ name: userInfo.value.authority.defaultRouter })
}
loadingInstance.value.close()
const isWin = ref(/windows/i.test(navigator.userAgent))