feat:付款码仅放行云闪付免密登录——验证码/未登录点付款码给引导提示
- 免密登录记 loginWay=ysf、验证码登录记 loginWay=sms,纳入账号缓存清理键(换账号不残留) - 详情页付款码桥就绪后校验登录方式,非 ysf 按登录态弹对应引导,不拉起容器付款码 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
d1e87498f5
commit
69a42cd6fc
+3
-1
@@ -1,7 +1,9 @@
|
|||||||
// xuchao: 账号级本地缓存集中管理。权益页首屏会读这些缓存做兜底展示,
|
// xuchao: 账号级本地缓存集中管理。权益页首屏会读这些缓存做兜底展示,
|
||||||
// 换账号/退出时漏清就会把上一个账号的中奖状态、卡号、到期时间当成当前账号的数据展示。
|
// 换账号/退出时漏清就会把上一个账号的中奖状态、卡号、到期时间当成当前账号的数据展示。
|
||||||
|
// xuchao: loginWay 记录登录方式(ysf=云闪付免密 / sms=手机验证码)——付款码仅对免密登录开放,
|
||||||
|
// 换账号/退出后必须清掉,否则会把上个账号的免密状态带给新账号
|
||||||
const ACCOUNT_KEYS = ['token', 'phone', 'isAuth', 'hasWin', 'cardNumber', 'expiresTime',
|
const ACCOUNT_KEYS = ['token', 'phone', 'isAuth', 'hasWin', 'cardNumber', 'expiresTime',
|
||||||
'rightsCount', 'totalValueFen', 'authFlowStarted', 'authName', 'authIdNo']
|
'rightsCount', 'totalValueFen', 'authFlowStarted', 'authName', 'authIdNo', 'loginWay']
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
// 清空当前账号的本地会话与权益缓存(定位 lng/lat 属于设备信息,不在此列)
|
// 清空当前账号的本地会话与权益缓存(定位 lng/lat 属于设备信息,不在此列)
|
||||||
|
|||||||
@@ -138,6 +138,8 @@
|
|||||||
// 就会变成 Bearer [object Object],把所有鉴权接口全打挂
|
// 就会变成 Bearer [object Object],把所有鉴权接口全打挂
|
||||||
const issued = typeof res.data.accessToken === 'string' ? res.data.accessToken : ''
|
const issued = typeof res.data.accessToken === 'string' ? res.data.accessToken : ''
|
||||||
if (issued) uni.setStorageSync('token', issued)
|
if (issued) uni.setStorageSync('token', issued)
|
||||||
|
// xuchao: 标记本次会话为云闪付免密登录——商户详情付款码按此放行
|
||||||
|
uni.setStorageSync('loginWay', 'ysf')
|
||||||
this.$u.api.getEligibility({ phone: res.data.mobile, identityNo: res.data.idNo || '', name: res.data.name || '' }).then(eRes => {
|
this.$u.api.getEligibility({ phone: res.data.mobile, identityNo: res.data.idNo || '', name: res.data.name || '' }).then(eRes => {
|
||||||
if (eRes.errcode === 0) {
|
if (eRes.errcode === 0) {
|
||||||
uni.setStorageSync('isAuth', eRes.data.isAuth)
|
uni.setStorageSync('isAuth', eRes.data.isAuth)
|
||||||
|
|||||||
@@ -131,6 +131,8 @@ export default {
|
|||||||
const issued = [payload.accessToken, payload.token].find(v => typeof v === 'string' && v.length > 0)
|
const issued = [payload.accessToken, payload.token].find(v => typeof v === 'string' && v.length > 0)
|
||||||
uni.setStorageSync('token', issued || '')
|
uni.setStorageSync('token', issued || '')
|
||||||
uni.setStorageSync('phone', this.phone)
|
uni.setStorageSync('phone', this.phone)
|
||||||
|
// xuchao: 标记登录方式为手机验证码——付款码仅放行云闪付免密登录(ysf),验证码登录会被引导
|
||||||
|
uni.setStorageSync('loginWay', 'sms')
|
||||||
this.$u.api.getEligibility({ phone: this.phone, identityNo: '', name: '' }).then(eRes => {
|
this.$u.api.getEligibility({ phone: this.phone, identityNo: '', name: '' }).then(eRes => {
|
||||||
if (eRes.errcode === 0) {
|
if (eRes.errcode === 0) {
|
||||||
uni.setStorageSync('isAuth', eRes.data.isAuth)
|
uni.setStorageSync('isAuth', eRes.data.isAuth)
|
||||||
|
|||||||
@@ -175,6 +175,21 @@
|
|||||||
window.upsdk.pluginReady(() => {
|
window.upsdk.pluginReady(() => {
|
||||||
bridged = true
|
bridged = true
|
||||||
clearTimeout(timer)
|
clearTimeout(timer)
|
||||||
|
// xuchao: 付款码依赖云闪付账号与社保卡的绑定关系——只对免密登录(ysf)会话开放;
|
||||||
|
// 验证码登录/未登录时容器钱包账号与本活动身份可能不一致,提示而不是拉起
|
||||||
|
const way = uni.getStorageSync('loginWay')
|
||||||
|
if (way !== 'ysf') {
|
||||||
|
const logged = !!uni.getStorageSync('phone')
|
||||||
|
uni.showModal({
|
||||||
|
title: '暂无法使用付款码',
|
||||||
|
content: logged
|
||||||
|
? '当前为手机号验证码登录,付款码立减需通过云闪付App的活动入口进入(自动免密登录,与钱包账号一致)后使用。'
|
||||||
|
: '请在云闪付App中通过本活动入口进入页面(自动免密登录)后,再使用付款码享优惠。',
|
||||||
|
showCancel: false,
|
||||||
|
confirmText: '知道了'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
try { window.upsdk.qrCodePay() }
|
try { window.upsdk.qrCodePay() }
|
||||||
catch (e) { uni.showToast({ title: '拉起付款码失败,请重试', icon: 'none' }) }
|
catch (e) { uni.showToast({ title: '拉起付款码失败,请重试', icon: 'none' }) }
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user