fix: 云闪付入口存下后端签发的 accessToken

配合后端 tokenDecode 新增的 accessToken 字段:免密进入时保存会话凭证,后续接口才认得当前用户;后端未升级(无该字段)时不写入,行为与现在一致。
This commit is contained in:
jacobxu666
2026-09-15 10:45:54 +08:00
parent e836fb33c8
commit c80eef5112
+2
View File
@@ -76,6 +76,8 @@
// 否则请求仍带旧 accessToken,后端“会话优先”会把上一个账号的数据返回给这位用户
account.clearAccountCache()
uni.setStorageSync('phone', res.data.mobile)
// xuchao: 后端已为云闪付入口签发会员会话,存下 accessToken,后续接口才认得这个用户
if (res.data.accessToken) uni.setStorageSync('token', res.data.accessToken)
this.$u.api.getEligibility({ phone: res.data.mobile, identityNo: res.data.idNo || '', name: res.data.name || '' }).then(eRes => {
if (eRes.errcode === 0) {
uni.setStorageSync('isAuth', eRes.data.isAuth)