添加系统码

This commit is contained in:
浅念
2025-07-21 18:12:16 +08:00
parent 31cd18fade
commit c7d890809c
7 changed files with 150 additions and 103 deletions
+10
View File
@@ -25,6 +25,8 @@ export const useUserStore = defineStore(
const refreshToken = ref('')
const companyid = ref('')
const companyabbr = ref('')
const systemsid = ref('')
const systemsabbr = ref('')
const loginType = ref<'feishu' | 'upwd'>('upwd')
const tokenExpireAt = ref<number>(0)
@@ -76,6 +78,11 @@ export const useUserStore = defineStore(
companyid.value = id
companyabbr.value = abbr
}
const setSystems= (id: string, abbr: string) => {
systemsid.value = id
systemsabbr.value = abbr
}
function restoreTokenTimer() {
const expireAt = Number(localStorage.getItem('token_expire_at') || '0')
if (accessToken.value && expireAt > Date.now()) {
@@ -139,6 +146,8 @@ export const useUserStore = defineStore(
info,
companyid,
companyabbr,
systemsid,
systemsabbr,
searchHistory,
loginType,
accessToken,
@@ -155,6 +164,7 @@ export const useUserStore = defineStore(
setLockPassword,
setToken,
setCompany,
setSystems,
setLoginType,
logOut,
restoreTokenTimer