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-24 15:54:35 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1651e5416607118b74dc3087a376d902fe4cd01f
1651e541
1 parent
32dfe7b7
设置密码接口调整
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
9 deletions
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
sight_harmony/features/wdLogin/src/main/ets/pages/login/ForgetPasswordPage.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/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
View file @
1651e54
...
...
@@ -511,7 +511,12 @@ export class HttpUrlUtils {
}
static getVerifyCodeByTokenUrl() {
let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/sendVerifyCodeByToken";
let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/sendVerifyCodeByToken";
return url;
}
static getCheckVerifyCodeByToken() {
let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/checkVerifyCodeByToken";
return url;
}
...
...
sight_harmony/features/wdLogin/src/main/ets/pages/login/ForgetPasswordPage.ets
View file @
1651e54
...
...
@@ -96,6 +96,16 @@ struct ForgetPasswordPage {
if (this.isEmpty(this.phoneContent)) {
return
}
if(this.pageType == 1){
this.loginViewModel.sendVerifyCodeByToken().then(()=>{
promptAction.showToast({ message: "验证码已发送成功" })
}).catch((message: string)=>{
promptAction.showToast({ message: message })
})
return
}
this.loginViewModel.sendVerifyCode(this.phoneContent).then((verifyCode) => {
promptAction.showToast({ message: "验证码已发送成功" })
Logger.debug(TAG, "sendVerifyCode: " + verifyCode)
...
...
@@ -115,7 +125,20 @@ struct ForgetPasswordPage {
if (this.isEmpty(this.codeContent)) {
return
}
if(this.pageType == 1){
this.loginViewModel.checkVerifyCodeByToken(this.codeContent).then(()=>{
let params: SettingPasswordParams = {
pageID:'1',
phoneContent:this.phoneContent,
codeContent:this.codeContent,
pageType:this.pageType
}
WDRouterRule.jumpWithPage(WDRouterPage.settingPasswordPage, params)
}).catch((message: string)=>{
promptAction.showToast({ message: message })
})
return
}
this.loginViewModel.checkVerifyCode(this.phoneContent, this.codeContent).then(() => {
let params: SettingPasswordParams = {
pageID:'1',
...
...
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginModel.ets
View file @
1651e54
...
...
@@ -41,9 +41,9 @@ export class LoginModel {
let bean: Record<string, string> = {};
// bean['phoneNum'] = number
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return new Promise<string>((success, fail) => {
HttpRequest.post<ResponseDTO<string>>(HttpUrlUtils.getVerifyCodeByTokenUrl(), bean, headers).then((data: ResponseDTO<string>) => {
if (!data || !data.data) {
return new Promise<object>((success, fail) => {
HttpBizUtil.post<ResponseDTO<object>>(HttpUrlUtils.getVerifyCodeByTokenUrl(),bean, headers).then((data: ResponseDTO<object>) => {
if (!data) {
fail("数据为空")
return
}
...
...
@@ -51,7 +51,7 @@ export class LoginModel {
fail(data.message)
return
}
success(data
.data
)
success(data)
}, (error: Error) => {
fail(error.message)
Logger.debug("LoginViewModel:error ", error.toString())
...
...
@@ -148,9 +148,9 @@ export class LoginModel {
// bean['phone'] = phone
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return new Promise<CheckVerifyBean>((success, fail) => {
HttpRequest.post<ResponseDTO<CheckVerifyBean>>(HttpUrlUtils.getCheckVerify
ByTokenCodeUrl
(), bean, headers).then((data: ResponseDTO<CheckVerifyBean>) => {
HttpRequest.post<ResponseDTO<CheckVerifyBean>>(HttpUrlUtils.getCheckVerify
CodeByToken
(), bean, headers).then((data: ResponseDTO<CheckVerifyBean>) => {
Logger.debug("LoginViewModel:success2 ", data.message)
if (!data
|| !data.data
) {
if (!data) {
fail("数据为空")
return
}
...
...
@@ -158,7 +158,9 @@ export class LoginModel {
fail(data.message)
return
}
if(data.data){
success(data.data)
}
}, (error: Error) => {
Logger.debug("LoginViewModel:error2 ", error.toString())
fail(error.message)
...
...
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginViewModel.ets
View file @
1651e54
...
...
@@ -33,7 +33,7 @@ export class LoginViewModel {
}
sendVerifyCodeByToken() {
return new Promise<
string
>((success, fail) => {
return new Promise<
object
>((success, fail) => {
this.loginModel.sendVerifyCodeByToken().then((data) => {
success(data)
}).catch((message: string) => {
...
...
Please
register
or
login
to post a comment