
- 将SplashV2替换为SplashPage,优化应用启动流程。 - 在LoginModels中将用户ID参数更改为加密后的ID,增强安全性。 - 更新AppConfig中的API基础URL,确保与生产环境一致。 - 在CommonComponents中添加底部Tab栏图标映射逻辑,提升用户体验。 - 新增NineGridImagePicker组件,支持多图选择功能,优化CreateFeedPage的图片选择逻辑。 - 移除冗余的BottomTabView组件,简化视图结构,提升代码整洁性。 - 在MainPage中整合创建动态页面的逻辑,优化导航体验。 - 新增MePage视图,提供用户信息管理功能,增强应用的可用性。
78 lines
1.8 KiB
Swift
78 lines
1.8 KiB
Swift
enum AppEnvironment {
|
||
case development
|
||
case production
|
||
}
|
||
|
||
struct AppConfig {
|
||
static let current: AppEnvironment = {
|
||
#if DEBUG
|
||
return .development
|
||
#else
|
||
return .production
|
||
#endif
|
||
}()
|
||
|
||
static var baseURL: String {
|
||
switch current {
|
||
case .development:
|
||
return "http://beta.api.pekolive.com"
|
||
case .production:
|
||
return "https://api.epartylive.com"
|
||
}
|
||
}
|
||
|
||
/// Web页面路径前缀
|
||
/// - development环境: "/molistar"
|
||
/// - production环境: "/eparty"
|
||
static var webPathPrefix: String {
|
||
switch current {
|
||
case .development:
|
||
return "/molistar"
|
||
case .production:
|
||
return "/eparty"
|
||
}
|
||
}
|
||
|
||
// 添加更多环境变量
|
||
static var analyticsKey: String {
|
||
switch current {
|
||
case .development: return "dev_analytics_key"
|
||
case .production: return "prod_analytics_key"
|
||
}
|
||
}
|
||
|
||
// 运行时切换环境(用于测试)
|
||
// static func switchEnvironment(to env: Environment) {
|
||
// current = env
|
||
// }
|
||
|
||
// 网络调试配置
|
||
static var enableNetworkDebug: Bool {
|
||
switch current {
|
||
case .development:
|
||
return true
|
||
case .production:
|
||
return false
|
||
}
|
||
}
|
||
|
||
// 服务器信任配置
|
||
static var serverTrustPolicies: [String: ServerTrustEvaluating] {
|
||
switch current {
|
||
case .development:
|
||
return ["beta.api.molistar.xyz": DisabledTrustEvaluator()]
|
||
case .production:
|
||
return ["api.epartylive.com": PublicKeysTrustEvaluator()]
|
||
}
|
||
}
|
||
|
||
static var networkDebugEnabled: Bool {
|
||
switch current {
|
||
case .development:
|
||
return true
|
||
case .production:
|
||
return false
|
||
}
|
||
}
|
||
}
|