shishuangxi

设置密码接口调整

... ... @@ -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;
}
... ...
... ... @@ -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',
... ...
... ... @@ -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.getCheckVerifyByTokenCodeUrl(), bean, headers).then((data: ResponseDTO<CheckVerifyBean>) => {
HttpRequest.post<ResponseDTO<CheckVerifyBean>>(HttpUrlUtils.getCheckVerifyCodeByToken(), 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
}
success(data.data)
if(data.data){
success(data.data)
}
}, (error: Error) => {
Logger.debug("LoginViewModel:error2 ", error.toString())
fail(error.message)
... ...
... ... @@ -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) => {
... ...