Commit 25cf30001fb2d18ea808e583be261cac1b195d02

Authored by fengtao
1 parent b756c1fc

fix:DEFECT-611 修复未分配修改密码菜单显示404,没有此页面,应该显示为没有权限

... ... @@ -32,6 +32,7 @@
32 32 icon="ion:document-text-outline"
33 33 />
34 34 <MenuItem
  35 + v-if="ifExistChangePassword"
35 36 key="changePassword"
36 37 :text="t('layout.header.dropdownItemChangePassword')"
37 38 icon="ant-design:unlock-twotone"
... ... @@ -60,9 +61,7 @@
60 61 <script lang="ts">
61 62 // components
62 63 import { Dropdown, Menu } from 'ant-design-vue';
63   -
64 64 import { defineComponent, computed, ref, reactive } from 'vue';
65   -
66 65 import { useUserStore } from '/@/store/modules/user';
67 66 import { useHeaderSetting } from '/@/hooks/setting/useHeaderSetting';
68 67 import { useI18n } from '/@/hooks/web/useI18n';
... ... @@ -74,7 +73,9 @@
74 73 import { USER_INFO_KEY } from '/@/enums/cacheEnum';
75 74 import { getAuthCache } from '/@/utils/auth';
76 75 import { useRouter } from 'vue-router';
77   - type MenuEvent = 'logout' | 'doc' | 'lock' | 'personal';
  76 + import { usePermissionStoreWithOut } from '/@/store/modules/permission';
  77 +
  78 + type MenuEvent = 'logout' | 'doc' | 'lock' | 'personal' | 'changePassword';
78 79
79 80 export default defineComponent({
80 81 name: 'UserDropdown',
... ... @@ -89,6 +90,12 @@
89 90 theme: propTypes.oneOf(['dark', 'light']),
90 91 },
91 92 setup() {
  93 + //修复修改密码根据后端返回的权限标识来显隐
  94 + const usePermissionStore: any = usePermissionStoreWithOut();
  95 + let ifExistChangePassword = ref(false);
  96 + ifExistChangePassword.value =
  97 + usePermissionStore.getPermCodeList.includes('system:password:view');
  98 + //修复修改密码根据后端返回的权限标识来显隐
92 99 const refreshPersonlData = reactive({
93 100 avatar: '',
94 101 realName: '',
... ... @@ -175,6 +182,7 @@
175 182 getShowDoc,
176 183 register,
177 184 getUseLockPage,
  185 + ifExistChangePassword,
178 186 };
179 187 },
180 188 });
... ...