bug修复
This commit is contained in:
@@ -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%')
|
||||
|
||||
Reference in New Issue
Block a user