From c80eef51122f78432b4e163fb884e2ffabda2e23 Mon Sep 17 00:00:00 2001 From: jacobxu666 Date: Tue, 15 Sep 2026 10:45:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BA=91=E9=97=AA=E4=BB=98=E5=85=A5?= =?UTF-8?q?=E5=8F=A3=E5=AD=98=E4=B8=8B=E5=90=8E=E7=AB=AF=E7=AD=BE=E5=8F=91?= =?UTF-8?q?=E7=9A=84=20accessToken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 配合后端 tokenDecode 新增的 accessToken 字段:免密进入时保存会话凭证,后续接口才认得当前用户;后端未升级(无该字段)时不写入,行为与现在一致。 --- pages/index/index.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pages/index/index.vue b/pages/index/index.vue index 7ad14a7..c8072f4 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -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)