From 2b61c110888ba437af69a646501f7a16ee7d1c80 Mon Sep 17 00:00:00 2001 From: K <1175047471@qq.com> Date: Thu, 7 Mar 2024 11:34:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BB=86=E7=B2=92=E5=BA=A6=E6=9D=83?= =?UTF-8?q?=E9=99=90=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/user.ts | 1 + src/views/base/login/LoginForm.vue | 3 -- .../device/components/DeviceInfo.vue | 7 +++- .../components/composables/useDeviceInfo.ts | 5 +++ src/views/device-manage/device/detail.vue | 5 ++- src/views/device-manage/device/index.vue | 9 ++++- src/views/product/components/Model.vue | 13 ++++-- src/views/product/components/TopicManage.vue | 8 +++- .../composables/useModelAttribute.ts | 1 + src/views/product/detail.vue | 9 +++-- src/views/product/index.vue | 9 ++++- .../consumer/components/Product.vue | 1 + src/views/subscription/consumer/detail.vue | 9 +++-- src/views/subscription/consumer/index.vue | 8 +++- src/views/subscription/list/index.vue | 8 +++- src/views/system/dept/index.vue | 8 +++- src/views/system/menu/index.vue | 40 +++++-------------- src/views/system/role/index.vue | 9 ++++- src/views/system/tenant/index.vue | 9 ++++- src/views/system/user/index.vue | 8 +++- 20 files changed, 116 insertions(+), 54 deletions(-) diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 03b5524f..0ead3ce1 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -142,6 +142,7 @@ export const useUserStore = defineStore('app-user', { const userInfo = await getUserInfo() setTenantId(userInfo.user.tenantId) + usePermissionStore().changePermissionCode(userInfo.buttons) this.setUserInfo(userInfo) return userInfo }, diff --git a/src/views/base/login/LoginForm.vue b/src/views/base/login/LoginForm.vue index b698e3de..64d78615 100644 --- a/src/views/base/login/LoginForm.vue +++ b/src/views/base/login/LoginForm.vue @@ -6,7 +6,6 @@ import { LoginStateEnum, useFormRules, useFormValid, useLoginState } from './use import { useI18n } from '@/hooks/web/useI18n' import { useMessage } from '@/hooks/web/useMessage' import { useUserStore } from '@/store/modules/user' -import { usePermissionStore } from '@/store/modules/permission' import { useDesign } from '@/hooks/web/useDesign' const FormItem = Form.Item @@ -16,7 +15,6 @@ const { t } = useI18n() const { notification, createErrorModal } = useMessage() const { prefixCls } = useDesign('login') const userStore = useUserStore() -const permissionStore = usePermissionStore() const { setLoginState, getLoginState } = useLoginState() const { getFormRules } = useFormRules() @@ -44,7 +42,6 @@ async function handleLogin() { mode: 'none', // 不要默认的错误提示 }) if (userInfo) { - permissionStore.changePermissionCode(userInfo.buttons) notification.success({ message: t('sys.login.loginSuccessTitle'), description: `${t('sys.login.loginSuccessDesc')}: ${userInfo.user.realName}`, diff --git a/src/views/device-manage/device/components/DeviceInfo.vue b/src/views/device-manage/device/components/DeviceInfo.vue index cdfd2cc2..2a8ad237 100644 --- a/src/views/device-manage/device/components/DeviceInfo.vue +++ b/src/views/device-manage/device/components/DeviceInfo.vue @@ -5,6 +5,7 @@ import { useDeviceInfo } from './composables/useDeviceInfo' import { useDeviceProperties } from './composables/useDeviceProperties' import { Description } from '@/components/Description' import { useModelService } from '@/views/product/components/composables/useModelService' +import { usePermission } from '@/hooks/web/usePermission' const { data, scheam } = useDeviceInfo() @@ -19,13 +20,15 @@ const { deviceProperties, reloadReviceProperties, } = useDeviceProperties(() => selectedModelId.value, () => data.value?.deviceSn) + +const { hasPermission } = usePermission()