|
|
@@ -25,16 +25,15 @@ export function useLogin() {
|
|
|
DeviceID: ''
|
|
|
})
|
|
|
|
|
|
- const aa = async () => {
|
|
|
- // 等待服务初始化
|
|
|
- await service.onReady()
|
|
|
+ const queryBaseData = async () => {
|
|
|
+ await service.onReady() // 等待服务初始化
|
|
|
await Promise.all([
|
|
|
errorInfoStore.actions.getErrorInfoList(),
|
|
|
enumStore.actions.getAllEnumList(),
|
|
|
])
|
|
|
}
|
|
|
|
|
|
- const bb = async () => {
|
|
|
+ const queryLoginData = async () => {
|
|
|
await checkToken() // 令牌校验
|
|
|
await userStore.actions.getUserData()
|
|
|
futuresStore.actions.getGoodsList()
|
|
|
@@ -55,7 +54,7 @@ export function useLogin() {
|
|
|
localStorage.setItem('thj_loginId', formData.LoginID) // 记住登录ID
|
|
|
}
|
|
|
})
|
|
|
- await bb()
|
|
|
+ await queryLoginData()
|
|
|
eventBus.$emit('LoginNotify') // 登录成功通知
|
|
|
}
|
|
|
|
|
|
@@ -64,7 +63,7 @@ export function useLogin() {
|
|
|
logining.value = true
|
|
|
try {
|
|
|
// 等待加载业务数据
|
|
|
- await aa()
|
|
|
+ await queryBaseData()
|
|
|
// 自动登录
|
|
|
if (autoLogin) {
|
|
|
const encryptedData = localData.getValue('autoLoginEncryptedData')
|
|
|
@@ -78,7 +77,7 @@ export function useLogin() {
|
|
|
}
|
|
|
}
|
|
|
} else if (token.value) {
|
|
|
- await bb()
|
|
|
+ await queryLoginData()
|
|
|
}
|
|
|
} finally {
|
|
|
logining.value = false
|
|
|
@@ -90,7 +89,7 @@ export function useLogin() {
|
|
|
logining.value = true
|
|
|
try {
|
|
|
const params = { ...formData }
|
|
|
- await aa()
|
|
|
+ await queryBaseData()
|
|
|
await queryLoginId({
|
|
|
data: {
|
|
|
username: formData.LoginID
|