diff --git a/App.vue b/App.vue index 8fcbd8b..87b1532 100644 --- a/App.vue +++ b/App.vue @@ -1,5 +1,7 @@ diff --git a/pages/userManage/index.vue b/pages/userManage/index.vue index f4842c0..c11e7a5 100644 --- a/pages/userManage/index.vue +++ b/pages/userManage/index.vue @@ -3,9 +3,9 @@ - - {{!getIsLogin()?userInfo.name:"欢迎来到版宠师"}} + + {{getIsLogin()?userInfo.userName:"欢迎来到版宠师"}} import { + computed, ref } from "vue" import { @@ -106,9 +107,15 @@ getToken } from "../../utils/auth"; import tab from "../../plugins/tab"; + import { + useStore + } from "vuex" + const store = useStore(); const isLogin = ref(false) - const userInfo = ref({}) + const userInfo = computed(() => { + return store.getters.userInfo + }) if (getIsLogin() && getToken()) { userInfo.value = getStorage("userInfo") isLogin.value = true diff --git a/pages/workbenchManage/index.vue b/pages/workbenchManage/index.vue index 15c491d..b486af2 100644 --- a/pages/workbenchManage/index.vue +++ b/pages/workbenchManage/index.vue @@ -1,7 +1,6 @@