Files
e-party-iOS/yana/Configs/AppConfig.swift
edwinQQQ 128bf36c88 feat: 更新依赖和项目配置,优化代码结构
- 在Package.swift中注释掉旧的swift-composable-architecture依赖,并添加swift-case-paths依赖。
- 在Podfile中将iOS平台版本更新至16.0,并移除QCloudCOSXML/Transfer依赖,改为使用QCloudCOSXML。
- 更新Podfile.lock以反映依赖变更,确保项目依赖的准确性。
- 新增架构分析需求文档,明确项目架构评估和改进建议。
- 在多个文件中实现async/await语法,提升异步操作的可读性和性能。
- 更新日志输出方法,确保在调试模式下提供一致的调试信息。
- 优化多个视图组件,提升用户体验和代码可维护性。
2025-07-17 18:47:09 +08:00

79 lines
1.9 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

enum Environment {
case development
case production
}
struct AppConfig {
static let current: Environment = {
#if DEBUG
return .development
#else
return .production
#endif
}()
static var baseURL: String {
switch current {
case .development:
// return "http://192.168.10.211:8080"
return "http://beta.api.molistar.xyz"
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
}
}
}