From e5c7326a387a491a8bdccdc74d67f20f3b3daf79 Mon Sep 17 00:00:00 2001 From: xlzy <1017866168@qq.com> Date: Thu, 23 Mar 2023 23:11:14 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=9B=B4=E6=96=B0=E3=80=91=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E6=97=A7=E7=9A=84$store?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- snowy-admin-web/src/components/XnFormContainer/index.vue | 5 ++++- snowy-admin-web/src/layout/components/userbar.vue | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/snowy-admin-web/src/components/XnFormContainer/index.vue b/snowy-admin-web/src/components/XnFormContainer/index.vue index e975f98c..51948bb0 100644 --- a/snowy-admin-web/src/components/XnFormContainer/index.vue +++ b/snowy-admin-web/src/components/XnFormContainer/index.vue @@ -15,6 +15,8 @@ import { Drawer, Modal } from 'ant-design-vue' import { modalProps } from 'ant-design-vue/es/modal/Modal' import { drawerProps } from 'ant-design-vue/es/drawer' + import { mapState } from 'pinia' + import { globalStore } from '@/store' const FormContainerTypeEnum = { DRAWER: 'drawer', @@ -37,11 +39,12 @@ ...drawerProps }, computed: { + ...mapState(globalStore, ['formStyle']), slotKeys() { return Object.keys(this.$slots) }, isModal() { - return FormContainerTypeEnum.MODAL === this.$store.state.global.formStyle + return FormContainerTypeEnum.MODAL === this.formStyle } }, methods: { diff --git a/snowy-admin-web/src/layout/components/userbar.vue b/snowy-admin-web/src/layout/components/userbar.vue index 4e697248..50726abc 100644 --- a/snowy-admin-web/src/layout/components/userbar.vue +++ b/snowy-admin-web/src/layout/components/userbar.vue @@ -94,7 +94,6 @@ return { lang: [], settingDialog: false, - userInfo: {}, userName: '', userNameF: '', setDeawer: import.meta.env.VITE_SET_DRAWER @@ -107,7 +106,6 @@ created() { // 获取默认语言 this.lang = new Array(this.$TOOL.data.get('APP_LANG') || this.$CONFIG.LANG) - this.userInfo = this.$TOOL.data.get('USER_INFO') this.userName = this.userInfo?.userName || '' this.userNameF = this.userName.substring(0, 1) },