From be25d07d832dc91b036f51bc185c67b2a15f6932 Mon Sep 17 00:00:00 2001 From: jinyaqiu Date: Tue, 19 Aug 2025 20:34:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=99=BB=E5=BD=95=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wake/Utils/APIConfig.swift | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/wake/Utils/APIConfig.swift b/wake/Utils/APIConfig.swift index 3d3d33b..46f51f9 100644 --- a/wake/Utils/APIConfig.swift +++ b/wake/Utils/APIConfig.swift @@ -3,6 +3,7 @@ import Foundation /// API 配置信息 public enum APIConfig { /// API 基础 URL +<<<<<<< HEAD <<<<<<< HEAD public static let baseURL = "https://api-dev.memorywake.com:31274/api/v1" @@ -24,6 +25,21 @@ public enum APIConfig { public static let authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSJ9.eyJqdGkiOjczNjM0ODY2MTE1MDc2NDY0NjQsImlkZW50aXR5IjoiNzM1MDQzOTY2MzExNjYxOTg4OCIsImV4cCI6MTc1NjE5NjgxNX0.hRC_So6LHuR6Gx-bDyO8aliVOd-Xumul8M7cydi2pTxHPweBx4421AfZ5BjGoEEwRZPIXJ5z7a1aDB7qvjpLCA" >>>>>>> a207b78 (feat: 确认上传) +======= + 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 + } + +>>>>>>> 1814789 (feat: 登录接口联调) /// 认证请求头 public static var authHeaders: [String: String] { return [ @@ -33,7 +49,11 @@ public enum APIConfig { ] } <<<<<<< HEAD +<<<<<<< HEAD } ======= } >>>>>>> a207b78 (feat: 确认上传) +======= +} +>>>>>>> 1814789 (feat: 登录接口联调)