提取baseurl配置

This commit is contained in:
2025-10-31 13:05:34 +08:00
parent 10dfe9b1d6
commit eb0d3aaa71
4 changed files with 40 additions and 6 deletions

View File

@@ -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" // 替换为你的真实域名与前缀路径

25
Shared/KBConfig.h Normal file
View File

@@ -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 */

View File

@@ -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 = "<group>"; };
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 = "<group>"; };
A1B2C3D22EB0A0A100000001 /* KBFunctionTagCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBFunctionTagCell.h; sourceTree = "<group>"; };
A1B2C3D32EB0A0A100000001 /* KBFunctionTagCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBFunctionTagCell.m; sourceTree = "<group>"; };
A1B2C3E02EB0C0A100000001 /* KBNetworkManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBNetworkManager.h; sourceTree = "<group>"; };
@@ -182,6 +183,15 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
04FC98002EB36AAB007BD342 /* Shared */ = {
isa = PBXGroup;
children = (
04FC98012EB36AAB007BD342 /* KBConfig.h */,
);
path = Shared;
sourceTree = "<group>";
};
04C6EAB92EAF86530089C901 /* keyBoard */ = {
isa = PBXGroup;
children = (
@@ -545,6 +555,7 @@
children = (
04C6EAB92EAF86530089C901 /* keyBoard */,
04C6EAD72EAF870B0089C901 /* CustomKeyboard */,
04FC98002EB36AAB007BD342 /* Shared */,
727EC7542EAF848B00B36487 /* Products */,
2C53A0856097DCFBE7B55649 /* Pods */,
6E26572F95DCFDA6A6644133 /* Frameworks */,

View File

@@ -15,6 +15,8 @@
/// 三方
#import <Masonry/Masonry.h>
// 公共配置
#import "KBConfig.h"
/// 系统
#import <UIKit/UIKit.h>
@@ -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" // 替换为你的真实域名与前缀路径