From 5895c7c6073c57e2398176d9034225c416cd4c75 Mon Sep 17 00:00:00 2001 From: lzx_win <2602107437@qq.com> Date: Wed, 15 Oct 2025 12:02:40 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E7=9A=84=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在getUserInfo方法中,直接通过store更新用户信息,移除多余的本地变量赋值操作 --- App.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/App.vue b/App.vue index fb72a82..d7b6f99 100644 --- a/App.vue +++ b/App.vue @@ -43,9 +43,7 @@ async getUserInfo() { const res = await this.$api.login.getUserInfo(); if (res.code === 200) { - this.userInfo = res.result; - // 存储用户信息到store - this.$store.dispatch('updateUserInfo', this.userInfo) + this.$store.dispatch('updateUserInfo', this.userInfo) } },