1. 优化首页列表请求顺序,减短loading时间
2. 获取小程序版本并保存
This commit is contained in:
parent
01950eaf33
commit
e97763af57
4
App.vue
4
App.vue
@ -12,7 +12,9 @@
|
|||||||
useUserStore().updateLoginStatus(isLogin)
|
useUserStore().updateLoginStatus(isLogin)
|
||||||
},
|
},
|
||||||
// 账号信息
|
// 账号信息
|
||||||
appid: ''
|
appid: '',
|
||||||
|
// 小程序版本
|
||||||
|
envVersion: ''
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(useBluetoothStore, ['bluetoothStatus']),
|
...mapState(useBluetoothStore, ['bluetoothStatus']),
|
||||||
|
|||||||
@ -89,12 +89,13 @@
|
|||||||
})
|
})
|
||||||
const accountInfo = wx.getAccountInfoSync()
|
const accountInfo = wx.getAccountInfoSync()
|
||||||
getApp().globalData.appid = accountInfo.miniProgram.appId
|
getApp().globalData.appid = accountInfo.miniProgram.appId
|
||||||
|
getApp().globalData.envVersion = accountInfo.miniProgram.envVersion
|
||||||
this.deviceInfo = await this.getDeviceInfo()
|
this.deviceInfo = await this.getDeviceInfo()
|
||||||
|
|
||||||
const token = uni.getStorageSync('token')
|
const token = uni.getStorageSync('token')
|
||||||
if(token) {
|
if(token) {
|
||||||
|
this.getLockList(this.lockSearch)
|
||||||
await this.getUserInfo()
|
await this.getUserInfo()
|
||||||
await this.getLockList(this.lockSearch)
|
|
||||||
} else {
|
} else {
|
||||||
await this.homeLogin()
|
await this.homeLogin()
|
||||||
}
|
}
|
||||||
@ -121,8 +122,8 @@
|
|||||||
uni.setStorageSync('openid', data.openid)
|
uni.setStorageSync('openid', data.openid)
|
||||||
if(data.accessToken) {
|
if(data.accessToken) {
|
||||||
uni.setStorageSync('token', data.accessToken)
|
uni.setStorageSync('token', data.accessToken)
|
||||||
that.getUserInfo()
|
|
||||||
that.getLockList(that.lockSearch)
|
that.getLockList(that.lockSearch)
|
||||||
|
await that.getUserInfo()
|
||||||
that.updateLoginStatus(true)
|
that.updateLoginStatus(true)
|
||||||
resolve(true)
|
resolve(true)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user