feat: 更新项目配置和功能模块
- 修改Package.swift以支持iOS 15和macOS 12。 - 更新swift-tca-architecture-guidelines.mdc中的alwaysApply设置为false。 - 注释掉AppDelegate中的NIMSDK导入,移除不再使用的NIMConfigurationManager和NIMSessionManager文件。 - 添加新的API相关文件,包括EMailLoginFeature、IDLoginFeature和相关视图,增强登录功能。 - 更新APIConstants和APIEndpoints以反映新的API路径。 - 添加本地化支持文件,包含英文和中文简体的本地化字符串。 - 新增字体管理和安全工具类,支持AES和DES加密。 - 更新Xcode项目配置,调整版本号和启动画面设置。
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import UIKit
|
||||
import NIMSDK
|
||||
//import NIMSDK
|
||||
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||
@@ -11,20 +11,67 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
// }
|
||||
|
||||
#if DEBUG
|
||||
// 网络诊断
|
||||
let testURL = URL(string: "http://beta.api.molistar.xyz/client/init")!
|
||||
let request = URLRequest(url: testURL)
|
||||
|
||||
print("🛠 原生URLSession测试开始")
|
||||
URLSession.shared.dataTask(with: request) { data, response, error in
|
||||
print("""
|
||||
=== 网络诊断结果 ===
|
||||
响应状态码: \((response as? HTTPURLResponse)?.statusCode ?? -1)
|
||||
错误信息: \(error?.localizedDescription ?? "无")
|
||||
原始数据: \(data?.count ?? 0) bytes
|
||||
==================
|
||||
""")
|
||||
}.resume()
|
||||
// 🔍 DES加密已切换到OC版本
|
||||
// print("🔐 使用OC版本的DES加密")
|
||||
// DESEncryptOCTest.runInAppDelegate()
|
||||
|
||||
// 网络诊断 - 使用完整的登录参数测试
|
||||
// let testURL = URL(string: "http://192.168.10.211:8080/oauth/token")!
|
||||
// var request = URLRequest(url: testURL)
|
||||
// request.httpMethod = "POST"
|
||||
// request.setValue("application/json", forHTTPHeaderField: "Content-Type")
|
||||
// request.setValue("application/json", forHTTPHeaderField: "Accept")
|
||||
// request.setValue("zh-Hant", forHTTPHeaderField: "Accept-Language")
|
||||
//
|
||||
// // 添加完整的测试参数
|
||||
// let testParameters: [String: Any] = [
|
||||
// "ispType": "65535",
|
||||
// "phone": "3+TbIQYiwIk=",
|
||||
// "netType": 2,
|
||||
// "channel": "molistar_enterprise",
|
||||
// "version": "20.20.61",
|
||||
// "pub_sign": "2E7C50AA17A20B32A0023F20B7ECE108",
|
||||
// "osVersion": "16.4",
|
||||
// "deviceId": "b715b75715e3417c9c70e72bbe502c6c",
|
||||
// "grant_type": "password",
|
||||
// "os": "iOS",
|
||||
// "app": "youmi",
|
||||
// "password": "nTW/lEgupIQ=",
|
||||
// "client_id": "erban-client",
|
||||
// "lang": "zh-Hant-CN",
|
||||
// "client_secret": "uyzjdhds",
|
||||
// "Accept-Language": "zh-Hant",
|
||||
// "model": "iPhone XR",
|
||||
// "appVersion": "1.0.0"
|
||||
// ]
|
||||
//
|
||||
// do {
|
||||
// let jsonData = try JSONSerialization.data(withJSONObject: testParameters, options: .prettyPrinted)
|
||||
// request.httpBody = jsonData
|
||||
//
|
||||
// print("🛠 原生URLSession登录测试开始")
|
||||
// print("📍 测试端点: \(testURL.absoluteString)")
|
||||
// print("📦 请求参数: \(String(data: jsonData, encoding: .utf8) ?? "无法解析")")
|
||||
//
|
||||
// URLSession.shared.dataTask(with: request) { data, response, error in
|
||||
// DispatchQueue.main.async {
|
||||
// let statusCode = (response as? HTTPURLResponse)?.statusCode ?? -1
|
||||
// let responseString = data != nil ? String(data: data!, encoding: .utf8) ?? "无法解析响应" : "无数据"
|
||||
//
|
||||
// print("""
|
||||
// === 网络诊断结果 ===
|
||||
// 🔗 URL: \(testURL.absoluteString)
|
||||
// 📊 响应状态码: \(statusCode)
|
||||
// ❌ 错误信息: \(error?.localizedDescription ?? "无")
|
||||
// 📦 原始数据: \(data?.count ?? 0) bytes
|
||||
// 📄 响应内容: \(responseString)
|
||||
// ==================
|
||||
// """)
|
||||
// }
|
||||
// }.resume()
|
||||
// } catch {
|
||||
// print("❌ JSON序列化失败: \(error.localizedDescription)")
|
||||
// }
|
||||
#endif
|
||||
|
||||
// NIMConfigurationManager.setupNimSDK()
|
||||
|
Reference in New Issue
Block a user