给所有支付接口加上了支付宝
This commit is contained in:
@@ -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) || '认证失败');
|
||||
|
||||
Reference in New Issue
Block a user