给所有支付接口加上了支付宝

This commit is contained in:
2026-07-09 22:07:20 +08:00
parent 566aeaa3b7
commit 4b60ebbc10
18 changed files with 438 additions and 38 deletions

View File

@@ -189,10 +189,13 @@ async function submit(phoneCode, avatarPath) {
shoujihao_code: phoneCode,
});
// 无论手机号是否成功,都先更新已保存字段(如头像)的缓存
// 后端在手机号失败时仍会保存头像,返回 code 6 + data含已保存字段
const respData = (data && data.data) || data || {};
if (respData.touxiang) wx.setStorageSync('touxiang', respData.touxiang);
if (respData.phone) wx.setStorageSync('phone', respData.phone);
if (data && data.code === 0) {
const respData = data.data || data;
if (respData.phone) wx.setStorageSync('phone', respData.phone);
if (respData.touxiang) wx.setStorageSync('touxiang', respData.touxiang);
return respData;
}
throw new Error((data && data.msg) || '认证失败');