|
|
|
|
@ -102,11 +102,12 @@ export const weixin = {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (!weixin.isNull(res.data.errorcode) || res.data.errorcode == 0) {
|
|
|
|
|
console.log(res)
|
|
|
|
|
if (res.data.hasOwnProperty('errcode')) {
|
|
|
|
|
if (options.utilFail != undefined) {
|
|
|
|
|
options.utilFail(res.data.errormsg || '接口发生未知错误');
|
|
|
|
|
options.utilFail(res.data.errmsg || '接口发生未知错误');
|
|
|
|
|
} else {
|
|
|
|
|
options.utilFail(res.data.errormsg);
|
|
|
|
|
options.utilFail(res.data.errmsg);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (options.utilSuccess != undefined) {
|
|
|
|
|
@ -145,6 +146,7 @@ export const weixin = {
|
|
|
|
|
uni.login({
|
|
|
|
|
provider: 'weixin',
|
|
|
|
|
success: (res) => {
|
|
|
|
|
console.log(res.code)
|
|
|
|
|
uni.request({
|
|
|
|
|
url: appConfig.baseUrl + '/api/member/login-by-code',
|
|
|
|
|
method: 'POST',
|
|
|
|
|
@ -152,6 +154,7 @@ export const weixin = {
|
|
|
|
|
code: res.code
|
|
|
|
|
},
|
|
|
|
|
success: result => {
|
|
|
|
|
console.log(result)
|
|
|
|
|
const user_info1 = result.data.data.user_info
|
|
|
|
|
result.data.data.user_info.openid = user_info1.wechat_openid
|
|
|
|
|
uni.setStorageSync(user_info_key, result.data.data)
|
|
|
|
|
|