Commit 837991c5 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 84ff9c63
......@@ -55,6 +55,7 @@
},
methods: {
wxlogin() {
var that=this;
var obj = wx.getEnterOptionsSync()
......@@ -64,7 +65,7 @@
var advertiserId = '' // 账号id
var reqId = '' // 请求id
var promotionId = '' // aid
var productId='';
var productId = ''
if (obj.query.clueToken ?? '' != '') {
channel = 'tt'
......@@ -82,22 +83,22 @@
clueToken = obj.query.callback ?? ''
adId = obj.query.aid ?? ''
}
console.log("1");
uni.login({
provider: 'weixin',
success: function(loginRes) {
console.log("2"+loginRes.code);
that.post({
url: '/user/wechatlogin',
data: {
channel: channel,
clueToken: clueToken,
code: loginRes.code,
adId: adId,
advertiserId: advertiserId,
reqId: reqId,
creativeId: creativeId,
code: loginRes.code,
inviteUId: tempInviteUId
promotionId: promotionId,
productId: productId,
},
showLoading: false,
success: ({
......@@ -106,12 +107,16 @@
app.globalData.token = data.token;
app.globalData.userId = data.pk_id;
app.globalData.userInfo = data;
console.log("3");
redirectTo('home');
}
});
},
fail: function(err) {
console.log("4");
// 登录授权失败
message.notify('登录授权失败 错误码:'+err.code);
message.notify('登录授权失败 错误码:' + err.code);
}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment