diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index b91996ce..0bb37f1c 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -109,6 +109,7 @@ export const usePermissionStore = defineStore('app-permission', { let routes: AppRouteRecordRaw[] = [] const roleList = toRaw(userStore.getRoleList) || [] + const userInfo = toRaw(userStore.getUserInfo) || {} const { permissionMode = projectSetting.permissionMode } = appStore.getProjectConfig // 路由过滤器 在 函数filter 作为回调传入遍历使用 @@ -237,6 +238,11 @@ export const usePermissionStore = defineStore('app-permission', { break } + // 从用户中获取权限 + if (userInfo) { + this.setPermCodeList(userInfo.permissions) + } + patchHomeAffix(routes) return routes } diff --git a/src/views/system/post/PostModal.vue b/src/views/system/post/PostModal.vue index aa05763c..0d020ebe 100644 --- a/src/views/system/post/PostModal.vue +++ b/src/views/system/post/PostModal.vue @@ -12,7 +12,6 @@ import { createPost, getPost, updatePost } from '@/api/system/post' const emit = defineEmits(['success', 'register']) const isUpdate = ref(true) -const rowId = ref() const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({ labelWidth: 100, @@ -29,7 +28,6 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data if (unref(isUpdate)) { const res = await getPost(data.record.id) - rowId.value = res.id setFieldsValue({ ...res }) } }) diff --git a/src/views/system/post/index.vue b/src/views/system/post/index.vue index d26b9c67..41fb65b9 100644 --- a/src/views/system/post/index.vue +++ b/src/views/system/post/index.vue @@ -2,18 +2,23 @@