|
|
@@ -138,7 +138,12 @@ export default { |
|
|
|
// 不是小程序,则提交用户名、密码登录 |
|
|
|
// 是小程序,则申请授权码登录 |
|
|
|
if (!type) { |
|
|
|
loginResult = await this.HTTP_POST('/user/login', { username, password: this.MD5(password) }, '登录时发生错误') |
|
|
|
let postResult = await this.POST('/user/login', { username, password: this.MD5(password) }) |
|
|
|
if(postResult[1].data.code=='200'){ |
|
|
|
loginResult=postResult[1].data.data; |
|
|
|
}else{ |
|
|
|
this.TOAST(postResult[1].data.info); |
|
|
|
} |
|
|
|
} else { |
|
|
|
const [codeErr, { code } = {}] = await uni.login({ provider: type }) |
|
|
|
if (codeErr || !code) { |
|
|
@@ -151,7 +156,6 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
if (!loginResult) { |
|
|
|
this.TOAST(loginResult); |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|