shishuangxi

设置密码接口调整

@@ -511,7 +511,12 @@ export class HttpUrlUtils { @@ -511,7 +511,12 @@ export class HttpUrlUtils {
511 } 511 }
512 512
513 static getVerifyCodeByTokenUrl() { 513 static getVerifyCodeByTokenUrl() {
514 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/sendVerifyCodeByToken"; 514 + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/sendVerifyCodeByToken";
  515 + return url;
  516 + }
  517 +
  518 + static getCheckVerifyCodeByToken() {
  519 + let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/checkVerifyCodeByToken";
515 return url; 520 return url;
516 } 521 }
517 522
@@ -96,6 +96,16 @@ struct ForgetPasswordPage { @@ -96,6 +96,16 @@ struct ForgetPasswordPage {
96 if (this.isEmpty(this.phoneContent)) { 96 if (this.isEmpty(this.phoneContent)) {
97 return 97 return
98 } 98 }
  99 +
  100 + if(this.pageType == 1){
  101 + this.loginViewModel.sendVerifyCodeByToken().then(()=>{
  102 + promptAction.showToast({ message: "验证码已发送成功" })
  103 + }).catch((message: string)=>{
  104 + promptAction.showToast({ message: message })
  105 + })
  106 + return
  107 + }
  108 +
99 this.loginViewModel.sendVerifyCode(this.phoneContent).then((verifyCode) => { 109 this.loginViewModel.sendVerifyCode(this.phoneContent).then((verifyCode) => {
100 promptAction.showToast({ message: "验证码已发送成功" }) 110 promptAction.showToast({ message: "验证码已发送成功" })
101 Logger.debug(TAG, "sendVerifyCode: " + verifyCode) 111 Logger.debug(TAG, "sendVerifyCode: " + verifyCode)
@@ -115,7 +125,20 @@ struct ForgetPasswordPage { @@ -115,7 +125,20 @@ struct ForgetPasswordPage {
115 if (this.isEmpty(this.codeContent)) { 125 if (this.isEmpty(this.codeContent)) {
116 return 126 return
117 } 127 }
118 - 128 + if(this.pageType == 1){
  129 + this.loginViewModel.checkVerifyCodeByToken(this.codeContent).then(()=>{
  130 + let params: SettingPasswordParams = {
  131 + pageID:'1',
  132 + phoneContent:this.phoneContent,
  133 + codeContent:this.codeContent,
  134 + pageType:this.pageType
  135 + }
  136 + WDRouterRule.jumpWithPage(WDRouterPage.settingPasswordPage, params)
  137 + }).catch((message: string)=>{
  138 + promptAction.showToast({ message: message })
  139 + })
  140 + return
  141 + }
119 this.loginViewModel.checkVerifyCode(this.phoneContent, this.codeContent).then(() => { 142 this.loginViewModel.checkVerifyCode(this.phoneContent, this.codeContent).then(() => {
120 let params: SettingPasswordParams = { 143 let params: SettingPasswordParams = {
121 pageID:'1', 144 pageID:'1',
@@ -41,9 +41,9 @@ export class LoginModel { @@ -41,9 +41,9 @@ export class LoginModel {
41 let bean: Record<string, string> = {}; 41 let bean: Record<string, string> = {};
42 // bean['phoneNum'] = number 42 // bean['phoneNum'] = number
43 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 43 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
44 - return new Promise<string>((success, fail) => {  
45 - HttpRequest.post<ResponseDTO<string>>(HttpUrlUtils.getVerifyCodeByTokenUrl(), bean, headers).then((data: ResponseDTO<string>) => {  
46 - if (!data || !data.data) { 44 + return new Promise<object>((success, fail) => {
  45 + HttpBizUtil.post<ResponseDTO<object>>(HttpUrlUtils.getVerifyCodeByTokenUrl(),bean, headers).then((data: ResponseDTO<object>) => {
  46 + if (!data) {
47 fail("数据为空") 47 fail("数据为空")
48 return 48 return
49 } 49 }
@@ -51,7 +51,7 @@ export class LoginModel { @@ -51,7 +51,7 @@ export class LoginModel {
51 fail(data.message) 51 fail(data.message)
52 return 52 return
53 } 53 }
54 - success(data.data) 54 + success(data)
55 }, (error: Error) => { 55 }, (error: Error) => {
56 fail(error.message) 56 fail(error.message)
57 Logger.debug("LoginViewModel:error ", error.toString()) 57 Logger.debug("LoginViewModel:error ", error.toString())
@@ -148,9 +148,9 @@ export class LoginModel { @@ -148,9 +148,9 @@ export class LoginModel {
148 // bean['phone'] = phone 148 // bean['phone'] = phone
149 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 149 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
150 return new Promise<CheckVerifyBean>((success, fail) => { 150 return new Promise<CheckVerifyBean>((success, fail) => {
151 - HttpRequest.post<ResponseDTO<CheckVerifyBean>>(HttpUrlUtils.getCheckVerifyByTokenCodeUrl(), bean, headers).then((data: ResponseDTO<CheckVerifyBean>) => { 151 + HttpRequest.post<ResponseDTO<CheckVerifyBean>>(HttpUrlUtils.getCheckVerifyCodeByToken(), bean, headers).then((data: ResponseDTO<CheckVerifyBean>) => {
152 Logger.debug("LoginViewModel:success2 ", data.message) 152 Logger.debug("LoginViewModel:success2 ", data.message)
153 - if (!data || !data.data) { 153 + if (!data) {
154 fail("数据为空") 154 fail("数据为空")
155 return 155 return
156 } 156 }
@@ -158,7 +158,9 @@ export class LoginModel { @@ -158,7 +158,9 @@ export class LoginModel {
158 fail(data.message) 158 fail(data.message)
159 return 159 return
160 } 160 }
161 - success(data.data) 161 + if(data.data){
  162 + success(data.data)
  163 + }
162 }, (error: Error) => { 164 }, (error: Error) => {
163 Logger.debug("LoginViewModel:error2 ", error.toString()) 165 Logger.debug("LoginViewModel:error2 ", error.toString())
164 fail(error.message) 166 fail(error.message)
@@ -33,7 +33,7 @@ export class LoginViewModel { @@ -33,7 +33,7 @@ export class LoginViewModel {
33 } 33 }
34 34
35 sendVerifyCodeByToken() { 35 sendVerifyCodeByToken() {
36 - return new Promise<string>((success, fail) => { 36 + return new Promise<object>((success, fail) => {
37 this.loginModel.sendVerifyCodeByToken().then((data) => { 37 this.loginModel.sendVerifyCodeByToken().then((data) => {
38 success(data) 38 success(data)
39 }).catch((message: string) => { 39 }).catch((message: string) => {