From 586eb879891e852e50302206470149766c35ee08 Mon Sep 17 00:00:00 2001
From: 杨锴 <841720330@qq.com>
Date: 星期四, 05 九月 2024 15:07:57 +0800
Subject: [PATCH] fix API Login

---
 XQMuse/Root/Login/VC/ForgotPasswordInputCodeVC.swift |   31 ++++++++++++++++++++++++-------
 1 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/XQMuse/Root/Login/VC/ForgotPasswordInputCodeVC.swift b/XQMuse/Root/Login/VC/ForgotPasswordInputCodeVC.swift
index 70f83d7..1b6cc8a 100644
--- a/XQMuse/Root/Login/VC/ForgotPasswordInputCodeVC.swift
+++ b/XQMuse/Root/Login/VC/ForgotPasswordInputCodeVC.swift
@@ -43,7 +43,7 @@
 								super.viewDidAppear(animated)
 								c1.becomeFirstResponder()
 								c1.jq_borderWidth = 1
-								starTimer()
+								sendCode()
 				}
 
     override func viewDidLoad() {
@@ -92,6 +92,13 @@
 								}
 				}
 
+
+				private func sendCode(){
+								Services.sendCode(type: .forgetPwd).subscribe(onNext: { _ in
+												self.starTimer()
+								}).disposed(by: disposeBag)
+				}
+
 				private func starTimer(){
 								times = 60
 								btn_retry.isEnabled = false
@@ -115,19 +122,29 @@
 				}
 
 				@IBAction func checkingAction(_ sender: UIButton) {
+								view.endEditing(true)
 								if inputCode.count != 6{
 												alertError(msg: "请输入验证码");return
 								}
-								view.endEditing(true)
-								Popup_1_View.show(state: .success, title: "验证成功", subtitle:"手机号验证成功") {
-												let vc = ForgotPasswordChangeVC()
-												self.push(vc: vc)
-								}
+
+								Services.forgotPwdVerifyCode(cellPhone: phone, captcha: inputCode).subscribe(onNext: {data in
+																if data.data?.successFlag ?? false{
+																				Popup_1_View.show(state: .success, title: "验证成功", subtitle:"手机号验证成功") {
+																								let vc = ForgotPasswordChangeVC(phone:self.phone,secretCode: data.data?.secret ?? "")
+																								self.push(vc: vc)
+																				}
+																}else{
+																				Popup_1_View.show(state: .fail, title: "验证失败", subtitle:"手机号验证失败") {
+
+																				}
+																}
+								}).disposed(by: disposeBag)
+
 				}
 
 				@IBAction func tryAgainAction(_ sender: UIButton) {
 								view.endEditing(true)
-								starTimer()
+								sendCode()
 				}
 				
 

--
Gitblit v1.7.1