From 2b0c8ec31f9e90ecdbe673948c3b3a3019a8f5fb Mon Sep 17 00:00:00 2001 From: xingyu Date: Wed, 20 Jul 2022 11:22:20 +0800 Subject: [PATCH] fix: router error --- .../src/components/UserInfo/src/UserInfo.vue | 5 +++-- yudao-ui-admin-vue3/src/router/modules/remaining.ts | 13 ++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/yudao-ui-admin-vue3/src/components/UserInfo/src/UserInfo.vue b/yudao-ui-admin-vue3/src/components/UserInfo/src/UserInfo.vue index 30e151dd3..1801e7078 100644 --- a/yudao-ui-admin-vue3/src/components/UserInfo/src/UserInfo.vue +++ b/yudao-ui-admin-vue3/src/components/UserInfo/src/UserInfo.vue @@ -7,6 +7,7 @@ import { resetRouter } from '@/router' import { useRouter } from 'vue-router' import { useDesign } from '@/hooks/web/useDesign' import { useTagsViewStore } from '@/store/modules/tagsView' +import avatarImg from '@/assets/imgs/avatar.gif' const tagsViewStore = useTagsViewStore() @@ -22,9 +23,9 @@ const { push, replace } = useRouter() const user = wsCache.get('user') -const avatar = user?.user?.avatar ? user.user.avatar : '@/assets/imgs/avatar.gif' +const avatar = user.user.avatar ? user.user.avatar : avatarImg -const userName = user?.user?.nickname ? user.user.nickname : 'Admin' +const userName = user.user.nickname ? user.user.nickname : 'Admin' const loginOut = () => { ElMessageBox.confirm(t('common.loginOutMessage'), t('common.reminder'), { diff --git a/yudao-ui-admin-vue3/src/router/modules/remaining.ts b/yudao-ui-admin-vue3/src/router/modules/remaining.ts index 1b48de376..56536fcf3 100644 --- a/yudao-ui-admin-vue3/src/router/modules/remaining.ts +++ b/yudao-ui-admin-vue3/src/router/modules/remaining.ts @@ -43,7 +43,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ { path: '/user', component: Layout, - name: 'User', + name: 'UserInfo', meta: { hidden: true }, @@ -53,9 +53,10 @@ const remainingRouter: AppRouteRecordRaw[] = [ component: () => import('@/views/Profile/Index.vue'), name: 'Profile', meta: { - hidden: true, - icon: 'ep:user', canTo: true, + hidden: true, + noTagsView: true, + icon: 'ep:user', title: t('common.profile') } } @@ -64,7 +65,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ { path: '/codegen', component: Layout, - name: 'Codegen', + name: 'CodegenEdit', meta: { hidden: true }, @@ -74,7 +75,6 @@ const remainingRouter: AppRouteRecordRaw[] = [ component: () => import('@/views/infra/codegen/EditTable.vue'), name: 'EditTable', meta: { - noTagsView: true, noCache: true, hidden: true, canTo: true, @@ -88,7 +88,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ { path: '/job', component: Layout, - name: 'Job', + name: 'JobL', meta: { hidden: true }, @@ -98,7 +98,6 @@ const remainingRouter: AppRouteRecordRaw[] = [ component: () => import('@/views/infra/job/JobLog.vue'), name: 'JobLog', meta: { - noTagsView: true, noCache: true, hidden: true, canTo: true,