1. 优化首页列表请求顺序,减短loading时间

2. 获取小程序版本并保存
This commit is contained in:
范鹏 2024-08-30 10:28:06 +08:00
parent 01950eaf33
commit e97763af57
2 changed files with 6 additions and 3 deletions

View File

@ -12,7 +12,9 @@
useUserStore().updateLoginStatus(isLogin)
},
//
appid: ''
appid: '',
//
envVersion: ''
},
computed: {
...mapState(useBluetoothStore, ['bluetoothStatus']),

View File

@ -89,12 +89,13 @@
})
const accountInfo = wx.getAccountInfoSync()
getApp().globalData.appid = accountInfo.miniProgram.appId
getApp().globalData.envVersion = accountInfo.miniProgram.envVersion
this.deviceInfo = await this.getDeviceInfo()
const token = uni.getStorageSync('token')
if(token) {
this.getLockList(this.lockSearch)
await this.getUserInfo()
await this.getLockList(this.lockSearch)
} else {
await this.homeLogin()
}
@ -121,8 +122,8 @@
uni.setStorageSync('openid', data.openid)
if(data.accessToken) {
uni.setStorageSync('token', data.accessToken)
that.getUserInfo()
that.getLockList(that.lockSearch)
await that.getUserInfo()
that.updateLoginStatus(true)
resolve(true)
} else {