统一api
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
// 公共配置
|
// 公共配置
|
||||||
#import "KBConfig.h"
|
#import "KBConfig.h"
|
||||||
|
#import "KBAPI.h" // 接口路径宏(统一管理)
|
||||||
#import "Masonry.h"
|
#import "Masonry.h"
|
||||||
#import "KBHUD.h" // 复用 App 内的 HUD 封装
|
#import "KBHUD.h" // 复用 App 内的 HUD 封装
|
||||||
#import "KBLocalizationManager.h" // 复用多语言封装(可在扩展内使用)
|
#import "KBLocalizationManager.h" // 复用多语言封装(可在扩展内使用)
|
||||||
|
|||||||
21
Shared/KBAPI.h
Normal file
21
Shared/KBAPI.h
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
//
|
||||||
|
// KBAPI.h
|
||||||
|
// 统一管理所有接口路径的宏,避免在代码中散落硬编码字符串。
|
||||||
|
// 注意:这里的路径为相对 KB_BASE_URL 的“相对路径”,可带或不带开头的斜杠。
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef KBAPI_h
|
||||||
|
#define KBAPI_h
|
||||||
|
|
||||||
|
// 用户与认证
|
||||||
|
#ifndef KB_API_USER_APPLE_LOGIN
|
||||||
|
#define API_APPLE_LOGIN @"/user/appleLogin" // Apple 登录
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// 应用配置
|
||||||
|
#ifndef KB_API_APP_CONFIG
|
||||||
|
#define KB_API_APP_CONFIG @"app/config" // 获取 App 配置
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* KBAPI_h */
|
||||||
|
|
||||||
@@ -176,6 +176,7 @@
|
|||||||
/* End PBXCopyFilesBuildPhase section */
|
/* End PBXCopyFilesBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
|
04122F592EC5D40000EF7AB3 /* KBAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBAPI.h; sourceTree = "<group>"; };
|
||||||
0459D1B22EBA284C00F2D189 /* KBSkinCenterVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBSkinCenterVC.h; sourceTree = "<group>"; };
|
0459D1B22EBA284C00F2D189 /* KBSkinCenterVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBSkinCenterVC.h; sourceTree = "<group>"; };
|
||||||
0459D1B32EBA284C00F2D189 /* KBSkinCenterVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBSkinCenterVC.m; sourceTree = "<group>"; };
|
0459D1B32EBA284C00F2D189 /* KBSkinCenterVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBSkinCenterVC.m; sourceTree = "<group>"; };
|
||||||
0459D1B52EBA287900F2D189 /* KBSkinManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBSkinManager.h; sourceTree = "<group>"; };
|
0459D1B52EBA287900F2D189 /* KBSkinManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBSkinManager.h; sourceTree = "<group>"; };
|
||||||
@@ -1146,6 +1147,7 @@
|
|||||||
children = (
|
children = (
|
||||||
04A9FE1F2EB893F10020DB6D /* Localization */,
|
04A9FE1F2EB893F10020DB6D /* Localization */,
|
||||||
04FC98012EB36AAB007BD342 /* KBConfig.h */,
|
04FC98012EB36AAB007BD342 /* KBConfig.h */,
|
||||||
|
04122F592EC5D40000EF7AB3 /* KBAPI.h */,
|
||||||
A1B2C4002EB4A0A100000001 /* KBAuthManager.h */,
|
A1B2C4002EB4A0A100000001 /* KBAuthManager.h */,
|
||||||
A1B2C4002EB4A0A100000002 /* KBAuthManager.m */,
|
A1B2C4002EB4A0A100000002 /* KBAuthManager.m */,
|
||||||
A1B2C4232EB4B7A100000001 /* KBKeyboardPermissionManager.h */,
|
A1B2C4232EB4B7A100000001 /* KBKeyboardPermissionManager.h */,
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ static NSString * const kKBKeyboardExtensionBundleId = @"com.loveKey.nyx.CustomK
|
|||||||
NSDictionary *params = @{
|
NSDictionary *params = @{
|
||||||
@"code": tokenString ?: @"",
|
@"code": tokenString ?: @"",
|
||||||
};
|
};
|
||||||
[[KBNetworkManager shared] POST:@"/user/appleLogin" jsonBody:params headers:nil completion:^(id _Nullable jsonOrData, NSURLResponse * _Nullable response, NSError * _Nullable error) {
|
[[KBNetworkManager shared] POST:API_APPLE_LOGIN jsonBody:params headers:nil completion:^(id _Nullable jsonOrData, NSURLResponse * _Nullable response, NSError * _Nullable error) {
|
||||||
NSLog(@"=====");
|
NSLog(@"=====");
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 248 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 248 KiB |
BIN
keyBoard/Assets.xcassets/AppIcon.appiconset/AppIcon60x60@2x.png
Normal file
BIN
keyBoard/Assets.xcassets/AppIcon.appiconset/AppIcon60x60@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 248 KiB |
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"images" : [
|
"images" : [
|
||||||
{
|
{
|
||||||
|
"filename" : "AppIcon60x60@2x.png",
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"platform" : "ios",
|
"platform" : "ios",
|
||||||
"size" : "1024x1024"
|
"size" : "1024x1024"
|
||||||
@@ -12,6 +13,7 @@
|
|||||||
"value" : "dark"
|
"value" : "dark"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"filename" : "AppIcon60x60@2x 1.png",
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"platform" : "ios",
|
"platform" : "ios",
|
||||||
"size" : "1024x1024"
|
"size" : "1024x1024"
|
||||||
@@ -23,6 +25,7 @@
|
|||||||
"value" : "tinted"
|
"value" : "tinted"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"filename" : "AppIcon60x60@2x 2.png",
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"platform" : "ios",
|
"platform" : "ios",
|
||||||
"size" : "1024x1024"
|
"size" : "1024x1024"
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{ [self.textView becomeFirstResponder]; });
|
dispatch_async(dispatch_get_main_queue(), ^{ [self.textView becomeFirstResponder]; });
|
||||||
|
|
||||||
[[KBNetworkManager shared] GET:@"app/config" parameters:nil headers:nil completion:^(id _Nullable jsonOrData, NSURLResponse * _Nullable response, NSError * _Nullable error) {
|
[[KBNetworkManager shared] GET:KB_API_APP_CONFIG parameters:nil headers:nil completion:^(id _Nullable jsonOrData, NSURLResponse * _Nullable response, NSError * _Nullable error) {
|
||||||
NSLog(@"====");
|
NSLog(@"====");
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#import <Masonry/Masonry.h>
|
#import <Masonry/Masonry.h>
|
||||||
// 公共配置
|
// 公共配置
|
||||||
#import "KBConfig.h"
|
#import "KBConfig.h"
|
||||||
|
#import "KBAPI.h" // 接口路径宏(统一管理)
|
||||||
|
|
||||||
/// 系统
|
/// 系统
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user