2
This commit is contained in:
@@ -22,7 +22,8 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
import user from "../../../store/modules/user";
|
||||
import {
|
||||
businessSendSms,
|
||||
businessVerifyCode
|
||||
} from "@/api/login";
|
||||
@@ -41,6 +42,9 @@
|
||||
userInfo: {
|
||||
phoneNumber: "",
|
||||
areaCode: "",
|
||||
email: "",
|
||||
code: "",
|
||||
type: "email",
|
||||
},
|
||||
isRegister: false,
|
||||
};
|
||||
@@ -48,11 +52,18 @@
|
||||
onLoad(options) {
|
||||
const {
|
||||
userInfo,
|
||||
isRegister
|
||||
isRegister,
|
||||
resend
|
||||
} = options;
|
||||
console.log(userInfo,isRegister)
|
||||
this.userInfo = JSON.parse(userInfo);
|
||||
this.isRegister = JSON.parse(isRegister);
|
||||
this.startCount();
|
||||
if(resend == 1){
|
||||
this.count = 0;
|
||||
this.getSmsAgain();
|
||||
}else{
|
||||
this.startCount();
|
||||
}
|
||||
},
|
||||
onReady() {},
|
||||
methods: {
|
||||
@@ -63,10 +74,12 @@
|
||||
},
|
||||
checkCode(value) {
|
||||
const options = {
|
||||
phoneNumber: this.userInfo.phoneNumber,
|
||||
mobile: this.userInfo.phoneNumber,
|
||||
email: this.userInfo.email,
|
||||
type: this.userInfo.type,
|
||||
areaCode: `+${this.userInfo.areaCode}`,
|
||||
usedFor: this.isRegister ? SmsUserFor.Register : SmsUserFor.Reset,
|
||||
verifyCode: value,
|
||||
event: this.isRegister ? 'register' : 'reset_pwd',
|
||||
code: value,
|
||||
};
|
||||
businessVerifyCode(options)
|
||||
.then(() => {
|
||||
@@ -102,9 +115,11 @@
|
||||
getSmsAgain() {
|
||||
if (this.count === 0) {
|
||||
const options = {
|
||||
phoneNumber: this.userInfo.phoneNumber,
|
||||
mobile: this.userInfo.phoneNumber,
|
||||
email: this.userInfo.email,
|
||||
type: this.userInfo.type,
|
||||
areaCode: `+${this.userInfo.areaCode}`,
|
||||
usedFor: this.isRegister ? SmsUserFor.Register : SmsUserFor.Reset,
|
||||
event: this.isRegister ? 'register' : 'reset_pwd',
|
||||
};
|
||||
businessSendSms(options)
|
||||
.then(() => {
|
||||
|
||||
Reference in New Issue
Block a user