|
|
@@ -177,21 +177,19 @@ export default {
|
|
|
if(this.userType === 'salesman'){
|
|
|
userType = 2;
|
|
|
}
|
|
|
+ let self = this;
|
|
|
uni.login({
|
|
|
provider: 'weixin', //使用微信登录
|
|
|
success: function (loginRes) {
|
|
|
let jsCode = loginRes.code;
|
|
|
- login(this.phone, this.code,userType,jsCode).then(res => {
|
|
|
+ login(self.phone, self.code,userType,jsCode).then(res => {
|
|
|
// 登录成功 (res.code === 0)
|
|
|
uni.hideLoading();
|
|
|
|
|
|
if (res.code === 0) {
|
|
|
- if (res.data.isWxAuth == 1) {
|
|
|
- uni.setStorageSync('Authorization-status', true);
|
|
|
- }
|
|
|
setAdminToken(res.data.sessionId)
|
|
|
- this.setUserInfo(res.data);
|
|
|
- this.doLoginSuccess();
|
|
|
+ self.setUserInfo(res.data);
|
|
|
+ self.doLoginSuccess();
|
|
|
} else {
|
|
|
console.log('登录失败!' + res.msg);
|
|
|
uni.showToast({ title: err.msg || '登录失败', icon: 'none' });
|