From d1c70bb690d25778b306e0f1772fcaa65e1dd6e1 Mon Sep 17 00:00:00 2001 From: LiaoYijun Date: Wed, 13 Aug 2025 14:33:52 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E7=94=A8=E6=88=B7=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=8B=B1=E6=96=87=E5=90=8D=E6=97=B6=E6=98=BE=E7=A4=BA=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Auth.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/stores/Auth.js b/src/stores/Auth.js index b42adb9..033555e 100644 --- a/src/stores/Auth.js +++ b/src/stores/Auth.js @@ -4,6 +4,7 @@ import { appendRequestParams, fetchJSON, postForm } from '@/utils/request' import { HT_HOST } from "@/config" import { loadPageSpy } from '@/pageSpy' import { usingStorage } from '@/hooks/usingStorage' +import { isEmpty } from "@/utils/commons"; const KEY_LOGIN_TOKEN = 'G-STR:LOGIN_TOKEN' const KEY_TRAVEL_AGENCY_ID = 'G-INT:TRAVEL_AGENCY_ID' @@ -76,10 +77,10 @@ const useAuthStore = create(devtools((set, get) => ({ set(() => ({ currentUser: { username: userJson.LoginName, - realname: userJson.real_name, + realname: isEmpty(userJson.real_name) ? userJson.LoginName : userJson.real_name, rolesName: userJson.roles_name, emailAddress: userJson.LMI_listmail, - travelAgencyName: userJson.VName, + travelAgencyName: isEmpty(userJson.VName) ? userJson.LMI_VEI_SN : userJson.VName } }))