import Foundation /// API 配置信息 public enum APIConfig { /// API 基础 URL public static let baseURL = "https://api-dev.memorywake.com:31274/api/v1" /// 认证 token - 从 Keychain 中获取 public static var authToken: String { let token = KeychainHelper.getAccessToken() ?? "" if !token.isEmpty { print("🔑 [APIConfig] 当前访问令牌: \(token.prefix(10))...") // 只打印前10个字符,避免敏感信息完全暴露 } else { print("⚠️ [APIConfig] 未找到访问令牌") } return token } /// 认证请求头 public static var authHeaders: [String: String] { return [ "Authorization": "Bearer \(authToken)", "Content-Type": "application/json", "Accept": "application/json" ] } }