修复旅拍相册 API 未注入共享 APIClient 导致未登录错误。
在 RootView 注入 travelAlbumAPI,并将 travel_album 纳入首页常用功能;补充 App/Networking 依赖注入说明。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -42,6 +42,7 @@ struct RootView: View {
|
||||
@State private var scheduleAPI: ScheduleAPI
|
||||
@State private var inviteAPI: InviteAPI
|
||||
@State private var assetsAPI: AssetsAPI
|
||||
@State private var travelAlbumAPI: TravelAlbumAPI
|
||||
@State private var punchPointAPI: PunchPointAPI
|
||||
@State private var locationReportAPI: LocationReportAPI
|
||||
@StateObject private var homeLocationViewModel: HomeLocationViewModel
|
||||
@ -82,6 +83,7 @@ struct RootView: View {
|
||||
_scheduleAPI = State(initialValue: ScheduleAPI(client: apiClient))
|
||||
_inviteAPI = State(initialValue: InviteAPI(client: apiClient))
|
||||
_assetsAPI = State(initialValue: AssetsAPI(client: apiClient))
|
||||
_travelAlbumAPI = State(initialValue: TravelAlbumAPI(client: apiClient))
|
||||
_punchPointAPI = State(initialValue: PunchPointAPI(client: apiClient))
|
||||
let locationReportAPI = LocationReportAPI(client: apiClient)
|
||||
_locationReportAPI = State(initialValue: locationReportAPI)
|
||||
@ -147,6 +149,7 @@ struct RootView: View {
|
||||
.environment(\.scheduleAPI, scheduleAPI)
|
||||
.environment(\.inviteAPI, inviteAPI)
|
||||
.environment(\.assetsAPI, assetsAPI)
|
||||
.environment(\.travelAlbumAPI, travelAlbumAPI)
|
||||
.environment(\.punchPointAPI, punchPointAPI)
|
||||
.environment(\.locationReportAPI, locationReportAPI)
|
||||
.environmentObject(homeLocationViewModel)
|
||||
|
||||
Reference in New Issue
Block a user