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 } }))