This commit is contained in:
范鹏 2024-10-29 13:40:19 +08:00
parent cb46da07a0
commit c66735b8b9
3 changed files with 7 additions and 4 deletions

View File

@ -2,8 +2,8 @@
"name" : "wx-starlock", "name" : "wx-starlock",
"appid" : "__UNI__933D519", "appid" : "__UNI__933D519",
"description" : "", "description" : "",
"versionName" : "1.1.2", "versionName" : "1.1.3",
"versionCode" : "29", "versionCode" : "30",
"transformPx" : false, "transformPx" : false,
/* */ /* */
"mp-weixin" : { "mp-weixin" : {

View File

@ -303,7 +303,7 @@
js_code: loginRes.code js_code: loginRes.code
}) })
if(code === 0) { if(code === 0) {
setStorage('openid', data.openid) await setStorage('openid', data.openid)
if(data.accessToken) { if(data.accessToken) {
setStorage('token', data.accessToken) setStorage('token', data.accessToken)
that.getLockList(that.lockSearch) that.getLockList(that.lockSearch)

View File

@ -35,7 +35,10 @@ export const useUserStore = defineStore('user', {
}, },
async phoneLogin(params) { async phoneLogin(params) {
const { iv, encryptedData } = params const { iv, encryptedData } = params
const openid = getStorage('openid') const openid = await getStorage('openid')
if(!openid) {
return false
}
const { code, data } = await phoneLoginRequest({ iv, encryptedData, openid }) const { code, data } = await phoneLoginRequest({ iv, encryptedData, openid })
if(code === 0) { if(code === 0) {
setStorage('token', data.accessToken) setStorage('token', data.accessToken)