This commit is contained in:
commie
2025-11-23 01:01:52 +08:00
parent 6ec389ff41
commit 0783e46b4b
21 changed files with 6409 additions and 1264 deletions
+23 -8
View File
@@ -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(() => {