diff --git a/wake/ContentView.swift b/wake/ContentView.swift index 161e83c..7487812 100644 --- a/wake/ContentView.swift +++ b/wake/ContentView.swift @@ -267,7 +267,11 @@ struct ContentView: View { } .background(Color.themeTextWhiteSecondary) .navigationBarHidden(true) + .navigationBarBackButtonHidden(true) } + .navigationViewStyle(StackNavigationViewStyle()) + .navigationBarHidden(true) + .navigationBarBackButtonHidden(true) } /// 显示用户资料弹窗 diff --git a/wake/Utils/Router.swift b/wake/Utils/Router.swift index 0230790..428840d 100644 --- a/wake/Utils/Router.swift +++ b/wake/Utils/Router.swift @@ -12,6 +12,7 @@ enum AppRoute: Hashable { case memories case subscribe case userInfo + case content @ViewBuilder var view: some View { @@ -36,6 +37,8 @@ enum AppRoute: Hashable { SubscribeView() case .userInfo: UserInfo() + case .content: + ContentView() } } } diff --git a/wake/View/Blind/JoinModal.swift b/wake/View/Blind/JoinModal.swift index e215707..0d31259 100644 --- a/wake/View/Blind/JoinModal.swift +++ b/wake/View/Blind/JoinModal.swift @@ -35,7 +35,7 @@ struct JoinModal: View { Spacer() Button(action: { withAnimation { - isPresented = false + Router.shared.navigate(to: .content) } }) { Image(systemName: "xmark") diff --git a/wake/WakeApp.swift b/wake/WakeApp.swift index ec8f291..6b1ebdb 100644 --- a/wake/WakeApp.swift +++ b/wake/WakeApp.swift @@ -45,11 +45,9 @@ struct WakeApp: App { } else { // 根据登录状态显示不同视图 if authState.isAuthenticated { - // 已登录:显示userInfo页面 - MediaUploadView() + // 已登录:显示主页面 + ContentView() .environmentObject(authState) - // ContentView() - // .environmentObject(authState) } else { // 未登录:显示登录界面 LoginView()