|
|
@ -97,20 +97,27 @@ Page({ |
|
|
|
wxCode: code |
|
|
|
}; |
|
|
|
api.getToken(params).then((res) => { |
|
|
|
console.log(res); |
|
|
|
if (res.code == 0) { |
|
|
|
wx.setStorageSync('token', res.data.token); |
|
|
|
wx.setStorageSync('userId', res.data.userId); |
|
|
|
wx.setStorageSync('userTagKey', res.data.userTagKey); |
|
|
|
wx.setStorageSync('deptDataScopeList', JSON.stringify(res.data.deptDataScopeList)); |
|
|
|
wx.switchTab({ |
|
|
|
url: '/pages/home/home' |
|
|
|
}); |
|
|
|
if(res.data.userState == '4'){ |
|
|
|
wx.showToast({ |
|
|
|
title: '请确认账号密码是否正确或联系管理员!', |
|
|
|
icon: 'none', |
|
|
|
duration: 3000 |
|
|
|
}); |
|
|
|
}else { |
|
|
|
wx.setStorageSync('token', res.data.token); |
|
|
|
wx.setStorageSync('userId', res.data.userId); |
|
|
|
wx.setStorageSync('userTagKey', res.data.userTagKey); |
|
|
|
wx.setStorageSync('deptDataScopeList', JSON.stringify(res.data.deptDataScopeList)); |
|
|
|
wx.switchTab({ |
|
|
|
url: '/pages/home/home' |
|
|
|
}); |
|
|
|
} |
|
|
|
} else { |
|
|
|
wx.showToast({ |
|
|
|
title: res.msg, |
|
|
|
icon: 'none', |
|
|
|
duration: 2000 |
|
|
|
duration: 3000 |
|
|
|
}); |
|
|
|
} |
|
|
|
wx.hideLoading(); |
|
|
|