refactor: 更新 EPLoginTypesViewController 以简化表单验证和错误处理

主要变更:
1. 将 EPLoginTypesViewController 继承自 BaseViewController,提升代码结构。
2. 简化表单验证逻辑,仅检查输入是否为空,减少对 EPLoginValidator 的依赖。
3. 更新错误处理方式,使用 showErrorToast 替代 showAlert,提升用户体验。
4. 在 EPLoginService 中直接使用字符串常量替代 grantType 变量,简化代码。

此更新旨在提升代码可读性和用户交互体验,确保登录流程更加流畅。
This commit is contained in:
edwinQQQ
2025-10-14 16:47:47 +08:00
parent 955cc3622f
commit 9466b65b40
3 changed files with 66 additions and 63 deletions

View File

@@ -15,7 +15,6 @@ import Foundation
private let clientSecret = EPLoginConfig.API.clientSecret
private let clientId = EPLoginConfig.API.clientId
private let grantType = EPLoginConfig.API.grantType
private let version = EPLoginConfig.API.version
// MARK: - Private Helper Methods
@@ -151,7 +150,7 @@ import Foundation
client_secret: clientSecret,
version: version,
client_id: clientId,
grant_type: grantType)
grant_type: "password")
}
/// +
@@ -182,7 +181,7 @@ import Foundation
client_secret: clientSecret,
version: version,
client_id: clientId,
grant_type: grantType)
grant_type: "email")
}
/// +
@@ -215,7 +214,7 @@ import Foundation
client_secret: clientSecret,
version: version,
client_id: clientId,
grant_type: grantType,
grant_type: "password",
phoneAreaCode: areaCode)
}