feat: 优化视图组件与数据迁移逻辑
- 移除DataMigrationManager类,简化数据迁移逻辑。 - 在FeedListView和MeView中新增图片预览功能,提升用户体验。 - 更新OptimizedDynamicCardView以支持图片点击回调,增强交互性。 - 新增PreviewItem结构体以管理图片预览状态,提升代码可读性与维护性。 - 清理AppDelegate中的冗余代码,优化启动流程。
This commit is contained in:
@@ -3,84 +3,10 @@ import UIKit
|
||||
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
private func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) async -> Bool {
|
||||
|
||||
// isPerceptionCheckingEnabled = false
|
||||
|
||||
// 执行数据迁移(从 UserDefaults 到 Keychain)
|
||||
DataMigrationManager.performStartupMigration()
|
||||
|
||||
|
||||
// 预加载用户信息缓存
|
||||
await UserInfoManager.preloadCache()
|
||||
|
||||
// 开启网络监控
|
||||
// NetworkManager.shared.networkStatusChanged = { status in
|
||||
// print("🌍 网络状态更新:\(status)")
|
||||
// }
|
||||
|
||||
#if DEBUG
|
||||
// 🔍 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()
|
||||
|
||||
return true
|
||||
|
Reference in New Issue
Block a user