|
|
@@ -84,60 +84,109 @@ Component({
|
|
|
},
|
|
|
/* 处理登录 */
|
|
|
async handleLogin() {
|
|
|
- const s = _Http.baseUrl == "https://crm.meida.com:16691" ? await _Http.OldLogin(`?username=${this.data.accountno}&password=${encodeURIComponent(this.data.password)}`) : {
|
|
|
- success: false
|
|
|
- };
|
|
|
- if(s.msg == "用户已锁定或失效") return wx.showModal({
|
|
|
- title: '提示',
|
|
|
- content: s.msg,
|
|
|
- showCancel:false,
|
|
|
- })
|
|
|
- let res = s.success == true ? await _Http.SSO({
|
|
|
- "accountno": s.data.userinfo.username,
|
|
|
- "password": s.data.cookie.split("=")[1],
|
|
|
- "imagecaptcha": this.data.imagecaptcha || '',
|
|
|
- "systemclient": "wechatsaletool"
|
|
|
- }) : await _Http.login({
|
|
|
- "accountno": this.data.accountno,
|
|
|
- "password": md5.hexMD5(this.data.password),
|
|
|
- "imagecaptcha": this.data.imagecaptcha || '',
|
|
|
- "systemclient": "wechatsaletool"
|
|
|
- });
|
|
|
-
|
|
|
- if (res.remindchangepassword) return wx.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '当前密码为系统初始化密码,请修改后重新登录',
|
|
|
- showCancel: false,
|
|
|
- confirmText: "前去修改",
|
|
|
- complete: () => {
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/index/userCenter/changePassword/index?token=' + res.account_list[0].token
|
|
|
+ if (_Http.baseUrl == "https://crm.meida.com:16691") {
|
|
|
+ const s = _Http.baseUrl == "https://crm.meida.com:16691" ? await _Http.OldLogin(`?username=${this.data.accountno}&password=${encodeURIComponent(this.data.password)}`) : {
|
|
|
+ success: false
|
|
|
+ };
|
|
|
+ if (s.success == 'false') {
|
|
|
+ wx.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: s.msg,
|
|
|
+ showCancel: false,
|
|
|
})
|
|
|
- _Http.claerPassword = function () {
|
|
|
- this.setData({
|
|
|
- password: ""
|
|
|
- })
|
|
|
- }.bind(this);
|
|
|
getCurrentPages()[0].setData({
|
|
|
loading: false
|
|
|
})
|
|
|
+ return
|
|
|
}
|
|
|
- })
|
|
|
- getCurrentPages()[0].setData({
|
|
|
- loading: false
|
|
|
- })
|
|
|
- if (res.msg != '成功') {
|
|
|
- wx.showToast({
|
|
|
- title: res.msg,
|
|
|
- icon: "none"
|
|
|
+ let res = s.success == true ? await _Http.SSO({
|
|
|
+ "accountno": s.data.userinfo.username,
|
|
|
+ "password": s.data.cookie.split("=")[1],
|
|
|
+ "imagecaptcha": this.data.imagecaptcha || '',
|
|
|
+ "systemclient": "wechatsaletool"
|
|
|
+ }) : await _Http.login({
|
|
|
+ "accountno": this.data.accountno,
|
|
|
+ "password": md5.hexMD5(this.data.password),
|
|
|
+ "imagecaptcha": this.data.imagecaptcha || '',
|
|
|
+ "systemclient": "wechatsaletool"
|
|
|
+ });
|
|
|
+ if (res.remindchangepassword) return wx.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '当前密码为系统初始化密码,请修改后重新登录',
|
|
|
+ showCancel: false,
|
|
|
+ confirmText: "前去修改",
|
|
|
+ complete: () => {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/pages/index/userCenter/changePassword/index?token=' + res.account_list[0].token
|
|
|
+ })
|
|
|
+ _Http.claerPassword = function () {
|
|
|
+ this.setData({
|
|
|
+ password: ""
|
|
|
+ })
|
|
|
+ }.bind(this);
|
|
|
+ getCurrentPages()[0].setData({
|
|
|
+ loading: false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ getCurrentPages()[0].setData({
|
|
|
+ loading: false
|
|
|
})
|
|
|
- this.changeTimestamp()
|
|
|
+ if (res.msg != '成功') {
|
|
|
+ wx.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ this.changeTimestamp()
|
|
|
+ } else {
|
|
|
+ wx.setStorageSync('loginMsg', {
|
|
|
+ accountno: this.data.accountno,
|
|
|
+ password: (this.data.memory) ? this.data.password : ''
|
|
|
+ })
|
|
|
+ loginMsg.loginMsg(res);
|
|
|
+ }
|
|
|
} else {
|
|
|
- wx.setStorageSync('loginMsg', {
|
|
|
- accountno: this.data.accountno,
|
|
|
- password: (this.data.memory) ? this.data.password : ''
|
|
|
+ let res = await _Http.login({
|
|
|
+ "accountno": this.data.accountno,
|
|
|
+ "password": md5.hexMD5(this.data.password),
|
|
|
+ "imagecaptcha": this.data.imagecaptcha || '',
|
|
|
+ "systemclient": "wechatsaletool"
|
|
|
+ });
|
|
|
+ if (res.remindchangepassword) return wx.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '当前密码为系统初始化密码,请修改后重新登录',
|
|
|
+ showCancel: false,
|
|
|
+ confirmText: "前去修改",
|
|
|
+ complete: () => {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/pages/index/userCenter/changePassword/index?token=' + res.account_list[0].token
|
|
|
+ })
|
|
|
+ _Http.claerPassword = function () {
|
|
|
+ this.setData({
|
|
|
+ password: ""
|
|
|
+ })
|
|
|
+ }.bind(this);
|
|
|
+ getCurrentPages()[0].setData({
|
|
|
+ loading: false
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
- loginMsg.loginMsg(res);
|
|
|
+ getCurrentPages()[0].setData({
|
|
|
+ loading: false
|
|
|
+ })
|
|
|
+ if (res.msg != '成功') {
|
|
|
+ wx.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ this.changeTimestamp()
|
|
|
+ } else {
|
|
|
+ wx.setStorageSync('loginMsg', {
|
|
|
+ accountno: this.data.accountno,
|
|
|
+ password: (this.data.memory) ? this.data.password : ''
|
|
|
+ })
|
|
|
+ loginMsg.loginMsg(res);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|