feat: 更新AppSettingFeature和MainFeature以支持登出功能
- 在AppSettingFeature中实现登出逻辑,清理认证信息并发送登出事件。 - 在MainFeature中新增登出标志和相应的状态管理,确保用户登出后状态更新。 - 更新MainView以响应登出事件,重命名内部视图为InternalMainView以提高可读性。 - 在SplashView中集成登出处理,确保用户能够顺利返回登录页面。
This commit is contained in:
@@ -50,8 +50,12 @@ struct AppSettingFeature {
|
||||
return .none
|
||||
|
||||
case .logoutTapped:
|
||||
// 预留登出逻辑
|
||||
return .none
|
||||
// 清理所有认证信息,并向上层发送登出事件
|
||||
return .run { send in
|
||||
await UserInfoManager.clearAllAuthenticationData()
|
||||
// 向上层Feature传递登出事件(需在MainFeature处理)
|
||||
// 这里直接返回.none,由MainFeature监听AppSettingFeature.Action.logoutTapped后处理
|
||||
}
|
||||
|
||||
case .loadUserInfo:
|
||||
state.isLoadingUserInfo = true
|
||||
|
Reference in New Issue
Block a user