a422d568 by simon

no message

1 parent 29013641
......@@ -31,7 +31,7 @@ Component({
getUserInfo(e) {
let _this = this;
app.globalData.userInfo = e.userInfo;
console.log("before register : code = ", app.store.getItem("wxcode") )
console.log("before register : code = ", app.store.getItem("wxcode"))
app.post({
url: app.api.register,
sid: false,
......@@ -43,6 +43,13 @@ Component({
}
}).then((res2) => {
wx.hideLoading();
if (res2 && res2.sessionId) {
app.store.setItem('sessionId', res2.sessionId);
// wx.showToast({
// title: '授权成功',
// icon: 'none'
// })
}
_this.hideMask();
}).catch((err) => {})
},
......
......@@ -3,21 +3,17 @@ let Store = require('./../utils/stroage');
let Router = require('./../router/index');
const errMsg = '服务异常,请稍后重试';
let isWxLogin = false;
// let isWxLogin = false;
function wxLogin() {
return new Promise((resolve, reject) => {
if (isWxLogin) {
resolve();
} else {
wx.login({
success: function (res) {
isWxLogin = true;
// isWxLogin = true;
Store.setItem('wxcode', res.code);
resolve();
}
});
}
});
}
......