Commit fe3d585b authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 5ef2184f
<template> <template>
<!-- Companionx -->
<view class="body loading"> <view class="body loading">
<view class="logo"> <view class="logo">
<image src="@/static/logo-about.png" mode="widthFix" style="border-radius: 20rpx;margin-bottom: 200rpx;" /> <image src="@/static/logo-about.png" mode="widthFix" style="border-radius: 20rpx;margin-bottom: 200rpx;" />
...@@ -83,11 +82,9 @@ ...@@ -83,11 +82,9 @@
clueToken = obj.query.callback ?? '' clueToken = obj.query.callback ?? ''
adId = obj.query.aid ?? '' adId = obj.query.aid ?? ''
} }
console.log("1");
uni.login({ uni.login({
provider: 'weixin', provider: 'weixin',
success: function(loginRes) { success: function(loginRes) {
console.log("2"+loginRes.code);
that.post({ that.post({
url: '/user/wechatlogin', url: '/user/wechatlogin',
data: { data: {
...@@ -107,14 +104,11 @@ ...@@ -107,14 +104,11 @@
app.globalData.token = data.token; app.globalData.token = data.token;
app.globalData.userId = data.pk_id; app.globalData.userId = data.pk_id;
app.globalData.userInfo = data; app.globalData.userInfo = data;
console.log("3");
redirectTo('home'); redirectTo('home');
} }
}); });
}, },
fail: function(err) { 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