Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
shishuangxi
2024-04-28 10:51:09 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6c79fe38ee21849bfe4b3b1aeb69425111c3854d
6c79fe38
1 parent
d3b81818
验证码修改4位限制
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginInputComponent.ets
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginModel.ets
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginViewModel.ets
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginInputComponent.ets
View file @
6c79fe3
...
...
@@ -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?"发送验证码":'重新发送')
...
...
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginModel.ets
View file @
6c79fe3
...
...
@@ -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())
...
...
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginViewModel.ets
View file @
6c79fe3
...
...
@@ -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) => {
...
...
Please
register
or
login
to post a comment