feat: 更新.gitignore,删除需求文档,优化API调试信息

- 在.gitignore中添加忽略项以排除不必要的文件。
- 删除架构分析需求文档以简化项目文档。
- 在APIEndpoints.swift和LoginModels.swift中移除调试信息的异步调用,提升代码简洁性。
- 在EMailLoginFeature.swift和HomeFeature.swift中新增登录流程状态管理,优化用户体验。
- 在多个视图中调整状态管理和导航逻辑,确保一致性和可维护性。
- 更新Xcode项目配置以增强调试信息的输出格式。
This commit is contained in:
edwinQQQ
2025-07-18 15:57:54 +08:00
parent 128bf36c88
commit fb7ae9e0ad
20 changed files with 562 additions and 720 deletions

View File

@@ -11,11 +11,20 @@ struct EMailLoginFeature {
var isCodeLoading: Bool = false
var errorMessage: String? = nil
var isCodeSent: Bool = false
//
var loginStep: LoginStep = .initial
enum LoginStep: Equatable {
case initial
case authenticating
case completed
case failed
}
#if DEBUG
init() {
self.email = "exzero@126.com"
self.verificationCode = ""
self.loginStep = .initial
}
#endif
}
@@ -109,6 +118,7 @@ struct EMailLoginFeature {
state.isLoading = true
state.errorMessage = nil
state.loginStep = .authenticating
return .run { send in
do {
@@ -149,14 +159,16 @@ struct EMailLoginFeature {
case .loginResponse(.success(let accountModel)):
state.isLoading = false
state.loginStep = .completed
// Effect AccountModel
return .run { _ in
await UserInfoManager.saveAccountModel(accountModel)
NotificationCenter.default.post(name: .ticketSuccess, object: nil)
// NotificationCenter.default.post(name: .ticketSuccess, object: nil)
}
case .loginResponse(.failure(let error)):
state.isLoading = false
state.loginStep = .failed
if let apiError = error as? APIError {
state.errorMessage = apiError.localizedDescription
} else {
@@ -174,6 +186,7 @@ struct EMailLoginFeature {
state.isCodeLoading = false
state.errorMessage = nil
state.isCodeSent = false
state.loginStep = .initial
return .none
}
}