From eb0d3aaa7168b40cc252f876621348b9270ccb88 Mon Sep 17 00:00:00 2001 From: CodeST <694468528@qq.com> Date: Fri, 31 Oct 2025 13:05:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E5=8F=96baseurl=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CustomKeyboard/PrefixHeader.pch | 5 ++--- Shared/KBConfig.h | 25 +++++++++++++++++++++++++ keyBoard.xcodeproj/project.pbxproj | 11 +++++++++++ keyBoard/KeyBoardPrefixHeader.pch | 5 ++--- 4 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 Shared/KBConfig.h diff --git a/CustomKeyboard/PrefixHeader.pch b/CustomKeyboard/PrefixHeader.pch index a12705a..f0c1ed9 100644 --- a/CustomKeyboard/PrefixHeader.pch +++ b/CustomKeyboard/PrefixHeader.pch @@ -15,11 +15,10 @@ #define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height #define imageNamed(s) [UIImage imageNamed:s] +// 公共配置 +#import "KBConfig.h" #import "Masonry.h" -// 网络基地址(Mock环境) -#define KB_BASE_URL @"https://m1.apifoxmock.com/m1/5438099-5113192-default/" - // 通用链接(Universal Links)统一配置 // 配置好 AASA 与 Associated Domains 后,只需修改这里即可切换域名/path。 #define KB_UL_BASE @"https://your.domain/ul" // 替换为你的真实域名与前缀路径 diff --git a/Shared/KBConfig.h b/Shared/KBConfig.h new file mode 100644 index 0000000..b5cf71c --- /dev/null +++ b/Shared/KBConfig.h @@ -0,0 +1,25 @@ +// +// KBConfig.h +// Shared config/macros for both main app and keyboard extension. +// +// Edit these values once and both targets pick them up via PCH import. +// + +#ifndef KBConfig_h +#define KBConfig_h + +// 基础baseUrl +#ifndef KB_BASE_URL +#define KB_BASE_URL @"https://m1.apifoxmock.com/m1/5438099-5113192-default/" +#endif + +// Universal Links 通用链接 +#ifndef KB_UL_BASE +#define KB_UL_BASE @"https://your.domain/ul" +#endif + +#define KB_UL_LOGIN KB_UL_BASE @"/login" +#define KB_UL_SETTINGS KB_UL_BASE @"/settings" + +#endif /* KBConfig_h */ + diff --git a/keyBoard.xcodeproj/project.pbxproj b/keyBoard.xcodeproj/project.pbxproj index 698d4a4..85d4a83 100644 --- a/keyBoard.xcodeproj/project.pbxproj +++ b/keyBoard.xcodeproj/project.pbxproj @@ -151,6 +151,7 @@ 51FE7C4C42C2255B3C1C4128 /* Pods-keyBoard.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-keyBoard.release.xcconfig"; path = "Target Support Files/Pods-keyBoard/Pods-keyBoard.release.xcconfig"; sourceTree = ""; }; 727EC7532EAF848B00B36487 /* keyBoard.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = keyBoard.app; sourceTree = BUILT_PRODUCTS_DIR; }; 967065BB5230E43F293B3AF9 /* Pods_keyBoard.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_keyBoard.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 04FC98012EB36AAB007BD342 /* KBConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBConfig.h; sourceTree = ""; }; A1B2C3D22EB0A0A100000001 /* KBFunctionTagCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBFunctionTagCell.h; sourceTree = ""; }; A1B2C3D32EB0A0A100000001 /* KBFunctionTagCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBFunctionTagCell.m; sourceTree = ""; }; A1B2C3E02EB0C0A100000001 /* KBNetworkManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBNetworkManager.h; sourceTree = ""; }; @@ -182,6 +183,15 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 04FC98002EB36AAB007BD342 /* Shared */ = { + isa = PBXGroup; + children = ( + 04FC98012EB36AAB007BD342 /* KBConfig.h */, + ); + path = Shared; + sourceTree = ""; + }; + 04C6EAB92EAF86530089C901 /* keyBoard */ = { isa = PBXGroup; children = ( @@ -545,6 +555,7 @@ children = ( 04C6EAB92EAF86530089C901 /* keyBoard */, 04C6EAD72EAF870B0089C901 /* CustomKeyboard */, + 04FC98002EB36AAB007BD342 /* Shared */, 727EC7542EAF848B00B36487 /* Products */, 2C53A0856097DCFBE7B55649 /* Pods */, 6E26572F95DCFDA6A6644133 /* Frameworks */, diff --git a/keyBoard/KeyBoardPrefixHeader.pch b/keyBoard/KeyBoardPrefixHeader.pch index 46847cf..24814f2 100644 --- a/keyBoard/KeyBoardPrefixHeader.pch +++ b/keyBoard/KeyBoardPrefixHeader.pch @@ -15,6 +15,8 @@ /// 三方 #import +// 公共配置 +#import "KBConfig.h" /// 系统 #import @@ -29,9 +31,6 @@ //-----------------------------------------------宏定义全局----------------------------------------------------------/ -// 网络基地址(Mock环境) -#define KB_BASE_URL @"https://m1.apifoxmock.com/m1/5438099-5113192-default/" - // 通用链接(Universal Links)统一配置 // 仅需修改这里的域名/前缀,工程内所有使用 UL 的地方都会同步。 #define KB_UL_BASE @"https://your.domain/ul" // 替换为你的真实域名与前缀路径