bug修复

This commit is contained in:
xiaoxiao
2025-06-13 16:24:54 +08:00
parent f649fd3480
commit 8300766e5c
5 changed files with 34 additions and 9 deletions
@@ -66,6 +66,24 @@ export struct ForgetPasswordComp {
})
}
uploadSmsAction(){
const hashMap: HashMap<string, string> = new HashMap();
hashMap.set('type','5');
hashMap.set('mobile',this.phoneNumber)
hdHttp.httpReq<string>(BasicConstant.urlExpertAPI+'smsSend',hashMap).then(async (res: HdResponse<string>) => {
let json:callBackData = JSON.parse(res+'') as callBackData;
console.log('获取验证码数据:',json);
if (json.code == 200) {
promptAction.showToast({message:'发送成功'});
this.startCountdown();
} else {
promptAction.showToast({message:json.message});
}
}).catch((err: BusinessError) => {
console.info(`Response login succeeded: ${err}`);
})
}
private startCountdown() {
this.countdown = 60
const timer = setInterval(() => {
@@ -134,11 +152,15 @@ export struct ForgetPasswordComp {
.margin({ top: 10 })
.enabled(this.countdown === 0)
.onClick(() => {
if (ChangeUtil.isMobileNum(this.phoneNumber)) {
this.startCountdown()
} else {
promptAction.showToast({message:'手机号格式错误,请重新输入'})
if (this.phoneNumber.length < 11 || !this.phoneNumber) {
promptAction.showToast({message:'请输入手机号'})
return
}
if (!ChangeUtil.isMobileNum(this.phoneNumber)) {
promptAction.showToast({message:'手机号格式错误,请重新输入'})
return
}
this.uploadSmsAction()
})
}
.width('95%')