模块化 AppStore 并完善素材管理与个人空间设置。
将会话、权限、位置、收款与排队存储拆分为独立模块,同步更新各 ViewModel 与单元测试,并补充素材管理 UI 与个人空间设置交互。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -44,7 +44,7 @@ final class LocationReportService {
|
||||
let remaining = Int((Self.operationIntervalMillis - (now - lastOnlineStatusSwitchTime)) / 1000)
|
||||
throw LocationReportServiceError.tooFrequent(remainingSeconds: remaining)
|
||||
}
|
||||
guard appStore.currentScenicId > 0 else {
|
||||
guard appStore.session.currentScenicId > 0 else {
|
||||
throw LocationReportServiceError.missingScenic
|
||||
}
|
||||
|
||||
@ -112,10 +112,10 @@ final class LocationReportService {
|
||||
}
|
||||
}
|
||||
|
||||
guard appStore.currentScenicId > 0 else {
|
||||
guard appStore.session.currentScenicId > 0 else {
|
||||
throw LocationReportServiceError.missingScenic
|
||||
}
|
||||
let staffId = appStore.userId.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
let staffId = appStore.session.userId.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
guard !staffId.isEmpty else {
|
||||
throw LocationReportServiceError.missingStaffId
|
||||
}
|
||||
@ -153,7 +153,7 @@ final class LocationReportService {
|
||||
longitude: snapshot.longitude,
|
||||
address: snapshot.address,
|
||||
type: type,
|
||||
scenicId: String(appStore.currentScenicId)
|
||||
scenicId: String(appStore.session.currentScenicId)
|
||||
)
|
||||
|
||||
lastLocationReportTime = currentTimestampMillis()
|
||||
|
||||
@ -34,7 +34,7 @@ final class LocationReportHistoryViewModel {
|
||||
/// 加载历史上报列表。
|
||||
func loadReportList(api: HomeAPI, refresh: Bool = false) async {
|
||||
guard !isLoading || refresh else { return }
|
||||
let staffId = appStore.userId.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
let staffId = appStore.session.userId.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
guard !staffId.isEmpty else {
|
||||
onShowMessage?("获取用户ID失败")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user