|
|
|
@ -125,6 +125,13 @@ export default { |
|
|
|
|
obtainCode() { |
|
|
|
|
if (this.countdown.num != 60) return; |
|
|
|
|
if (!this.checkParams(["username"])) return; |
|
|
|
|
serve.getVerifyCode({ username: this.params.username }).then((res) => { |
|
|
|
|
if (res.code == 20000) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: res.msg, |
|
|
|
|
icon: "none", |
|
|
|
|
}); |
|
|
|
|
this.params.verifyCodeToken = res.data.verifyCodeToken; |
|
|
|
|
|
|
|
|
|
let instance = setInterval(() => { |
|
|
|
|
if (!this.countdown.num) { |
|
|
|
@ -134,15 +141,6 @@ export default { |
|
|
|
|
} |
|
|
|
|
this.countdown.num -= 1; |
|
|
|
|
}, 1000); |
|
|
|
|
|
|
|
|
|
serve |
|
|
|
|
.verifyCodeLoginCheckAccountPersonal({ username: this.params.username }) |
|
|
|
|
.then((res) => { |
|
|
|
|
if (res.code == 20000) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: res.msg, |
|
|
|
|
}); |
|
|
|
|
this.params.verifyCodeToken = res.data.verifyCodeToken; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
@ -183,7 +181,12 @@ export default { |
|
|
|
|
realLogin() { |
|
|
|
|
if (!this.checkParams(["username", "verifyCode"])) return; |
|
|
|
|
|
|
|
|
|
serve.verifyCodeLoginPersonal(this.params).then((res) => { |
|
|
|
|
serve |
|
|
|
|
.verifyCodeRegister({ |
|
|
|
|
unionId: uni.getStorageSync("unionid"), |
|
|
|
|
...this.params, |
|
|
|
|
}) |
|
|
|
|
.then((res) => { |
|
|
|
|
if (res.code === 20000) { |
|
|
|
|
this.callbackLogin(res); |
|
|
|
|
} |
|
|
|
|