tangning 2 hónapja
szülő
commit
ab6c4ea8fa

+ 1 - 1
src/layouts/default/header/components/user-dropdown/index.vue

@@ -78,7 +78,7 @@
       const userStore = useUserStore();
       const { createConfirm } = useMessage();
       const getUserInfo = computed(() => {
-        const { head, desc ,agent } = userStore.getUserInfo || {};
+        const { head, desc, agent = {} } = userStore.getUserInfo || {};
         let realName = agent.name + agent.userName
         return { realName:realName, avatar: head || headerImg, desc };
       });

+ 1 - 0
src/locales/lang/en/code.ts

@@ -22,6 +22,7 @@ export default {
     '4020': 'Multiple login attempts detected, please try again in five minutes!',
     '4021': 'Distributor name already exists',
     '4022': 'The distributor account already exists',
+    '4028': 'Template format error',
     '4029': 'There is an error in line {value}',
     '4030': 'Account deactivated, please contact administrator',
     '4032': 'Insufficient permissions',

+ 1 - 0
src/locales/lang/zh-CN/code.ts

@@ -22,6 +22,7 @@ export default {
     '4020': '频繁登录失败,请五分钟后再次尝试登录!',
     '4021': '分销商名称已存在',
     '4022': '分销商账号已存在',
+    '4028': '模板格式错误',
     '4029': '第{value}行存在错误。',
     '4030': '当前账号已停用,请联系管理员',
     '4032': '权限不足',

+ 2 - 2
src/router/routes/modules/account.ts

@@ -13,7 +13,7 @@ export const Device: AppRouteRecordRaw = {
     icon: 'uil:user-md',
     orderNo: 6,
     hideChildrenInMenu: true,
-    roles: [RoleEnum.SUPER, RoleEnum.TEST, RoleEnum.LEVEL2],
+    roles: [RoleEnum.SUPER, RoleEnum.TEST],
   },
   children: [
     {
@@ -23,7 +23,7 @@ export const Device: AppRouteRecordRaw = {
       meta: {
         title: t('routes.dashboard.account'),
         hideBreadcrumb: true,
-        roles: [RoleEnum.SUPER, RoleEnum.TEST, RoleEnum.LEVEL2],
+        roles: [RoleEnum.SUPER, RoleEnum.TEST],
       },
     },
     {

+ 1 - 1
src/store/modules/user.ts

@@ -186,7 +186,7 @@ export const useUserStore = defineStore({
       this.setToken(undefined);
       this.setSessionTimeout(false);
       this.setUserInfo(null);
-      // goLogin && router.push(PageEnum.BASE_LOGIN);
+      goLogin && router.push(PageEnum.BASE_LOGIN);
     },
 
     /**

+ 3 - 1
src/views/device/index.vue

@@ -4,7 +4,9 @@
       <BasicTable @register="registerTable">
         <template #toolbar>
           <a-button
-            v-if="hasPermission([RoleEnum.SUPER, RoleEnum.TEST, RoleEnum.LEVEL2])"
+            v-if="
+              hasPermission([RoleEnum.SUPER, RoleEnum.TEST, RoleEnum.LEVEL2, RoleEnum.DISTRIBUTOR])
+            "
             @click="getTemplate"
           >
             {{ t('routes.device.export') }}</a-button