shishuangxi

验证码修改4位限制

... ... @@ -37,7 +37,7 @@ export struct LoginInputComponent {
.type(InputType.PhoneNumber)
.onChange((content) => {
this.phoneContent = content
this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 6)
this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4)
if (content.length >= 11) {
this.codeBtnState = true
} else {
... ... @@ -55,7 +55,7 @@ export struct LoginInputComponent {
.type(InputType.Number)
.onChange((content) => {
this.phoneContent = content
this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 6)
this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4)
if (content.length >= 11) {
this.codeBtnState = true
} else {
... ... @@ -78,7 +78,7 @@ export struct LoginInputComponent {
// .backgroundImageSize(ImageSize.Contain)
.onChange((value) => {
this.codeContent = value
this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 6)
this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4)
})
Text(this.isCodeSend ? this.timeCount + "s" : this.isFirst?"发送验证码":'重新发送')
... ...
... ... @@ -13,9 +13,9 @@ export class LoginModel {
sendVerifyCode(number: string) {
let bean: Record<string, string> = {};
bean['phoneNum'] = number
return new Promise<string>((success, fail) => {
HttpRequest.post<ResponseDTO<string>>(HttpUrlUtils.getVerifyCodeUrl(), bean).then((data: ResponseDTO<string>) => {
if (!data || !data.data) {
return new Promise<object>((success, fail) => {
HttpRequest.post<ResponseDTO<object>>(HttpUrlUtils.getVerifyCodeUrl(), bean).then((data: ResponseDTO<object>) => {
if (!data) {
fail("数据为空")
return
}
... ... @@ -23,7 +23,7 @@ export class LoginModel {
fail(data.message)
return
}
success(data.data)
success(data)
}, (error: Error) => {
fail(error.message)
Logger.debug("LoginViewModel:error ", error.toString())
... ...
... ... @@ -22,7 +22,7 @@ export class LoginViewModel {
//发送验证码
sendVerifyCode(number: string) {
return new Promise<string>((success, fail) => {
return new Promise<object>((success, fail) => {
this.loginModel.sendVerifyCode(number).then((data) => {
success(data)
}).catch((message: string) => {
... ...