南鑫林 vor 6 Jahren
Ursprung
Commit
61c2126cb8

BIN
RainbowPlanet/RainbowPlanet.xcworkspace/xcuserdata/nanxinlin.xcuserdatad/UserInterfaceState.xcuserstate


+ 16 - 0
RainbowPlanet/RainbowPlanet.xcworkspace/xcuserdata/nanxinlin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -21,5 +21,21 @@
             stopOnStyle = "0">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "RainbowPlanet/Tools/AppInfo/AppInfo.swift"
+            timestampString = "577004814.4119329"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "36"
+            endingLineNumber = "36"
+            landmarkName = "AppInfo"
+            landmarkType = "14">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 4 - 5
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaNetWorkManager/ApiMacro.swift

@@ -44,7 +44,6 @@ public enum HeaderType {
 public func headerParameters(headerType:HeaderType = .defaultHeader) -> Dictionary<String,Any> {
     var parameters = Dictionary<String,Any>()
 
-
     switch headerType {
     case .defaultHeader:
         parameters.updateValue("application/x-www-form-urlencoded", forKey: "Content-Type")
@@ -56,14 +55,14 @@ public func headerParameters(headerType:HeaderType = .defaultHeader) -> Dictiona
         parameters.updateValue(AppInfo.client_version, forKey: "client_version")
         parameters.updateValue(AppInfo.os_name, forKey: "os_name")
         parameters.updateValue(AppInfo.os_version, forKey: "os_version")
-        parameters.updateValue(AppInfo.device_name, forKey: "device_name")
+        parameters.updateValue(String(describing: AppInfo.device_name), forKey: "device_name")
         parameters.updateValue(AppInfo.uuid, forKey: "device_id")
         parameters.updateValue(AppInfo.ipAddress, forKey: "ip")
         break
     case .tokenHeader:
         parameters.updateValue("application/x-www-form-urlencoded", forKey: "Content-Type")
         let token = LoginModel.shared().getLoginModel()?.token ?? ""
-        parameters.updateValue("Authorization", forKey: token)
+        parameters.updateValue(token, forKey: "Authorization")
         break
     case .tokenMoreHeader:
         parameters.updateValue("application/x-www-form-urlencoded", forKey: "Content-Type")
@@ -72,11 +71,11 @@ public func headerParameters(headerType:HeaderType = .defaultHeader) -> Dictiona
         parameters.updateValue(AppInfo.client_version, forKey: "client_version")
         parameters.updateValue(AppInfo.os_name, forKey: "os_name")
         parameters.updateValue(AppInfo.os_version, forKey: "os_version")
-        parameters.updateValue(AppInfo.device_name, forKey: "device_name")
+        parameters.updateValue(String(describing: AppInfo.device_name), forKey: "device_name")
         parameters.updateValue(AppInfo.uuid, forKey: "device_id")
         parameters.updateValue(AppInfo.ipAddress, forKey: "ip")
         let token = LoginModel.shared().getLoginModel()?.token ?? ""
-        parameters.updateValue("Authorization", forKey: token)
+        parameters.updateValue(token, forKey: "Authorization")
         break
     }
 

+ 2 - 2
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaNetWorkManager/SwiftMoyaNetWorkManager.swift

@@ -48,9 +48,9 @@ private let requestClosure = { (endpoint: Endpoint, done: MoyaProvider.RequestRe
         request.timeoutInterval = requestTimeOut
         // 打印请求参数
         if let requestData = request.httpBody {
-            NXLLog("\n"+"请求地址:\n"+"\(request.url!)"+"\n"+"请求方式:\n"+"\(request.httpMethod ?? "")"+"\n"+"发送参数:\n"+"\(String(data: request.httpBody!, encoding: String.Encoding.utf8) ?? "")")
+            NXLLog("\n"+"请求地址:"+"\(request.url!)"+"\n"+"请求方式:"+"\(request.httpMethod ?? "")"+"\n"+"请求头部:"+"\(String(describing: request.allHTTPHeaderFields!))"+"\n"+"发送参数:"+"\(String(data: request.httpBody!, encoding: String.Encoding.utf8) ?? "")")
         }else{
-            NXLLog("\n"+"请求地址:\n"+"\(request.url!)"+"\n"+"请求方式:\n"+"=\(String(describing: request.httpMethod!))")
+            NXLLog("\n"+"请求地址:"+"\(request.url!)"+"\n"+"请求方式:"+"=\(String(describing: request.httpMethod!))"+"请求头部:"+"\(String(describing: request.allHTTPHeaderFields!))")
         }
         done(.success(request))
     } catch {

+ 1 - 1
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceSMS/SwiftMoyaServiceSMSApi.swift

@@ -36,7 +36,7 @@ enum SMSType : String {
 
 // MARK: - 发送验证码
 /// 发送验证码
-public let kSMSSendApi = "sms/send"
+public let kSMSSendApi = "/sms/send"
 
 /// 发送验证
 ///

+ 9 - 9
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceUser/SwiftMoyaServiceUserApi.swift

@@ -11,39 +11,39 @@ import Moya
 
 // MARK: - 登录
 /// 登录
-public let kUserLoginApi = "user/login"
+public let kUserLoginApi = "/user/login"
 
 // MARK: - 登出
 /// 登出
-public let kUserLogoutApi = "user/logout"
+public let kUserLogoutApi = "/user/logout"
 
 // MARK: - 刷新用户信息
 /// 刷新用户信息
-public let kUserRefreshApi = "user/refresh"
+public let kUserRefreshApi = "/user/refresh"
 
 // MARK: - 微信注册/登录
 /// 微信注册/登录
-public let kUserWeiXinRegisterApi = "user/weixinRegister"
+public let kUserWeiXinRegisterApi = "/user/weixinRegister"
 
 // MARK: - 手机验证码注册/登录
 /// 手机验证码注册/登录
-public let kUserMobileRegisterApi = "user/mobileRegister"
+public let kUserMobileRegisterApi = "/user/mobileRegister"
 
 // MARK: - 手机密码登录
 /// 手机密码登录
-public let kUserMobileLoginApi = "user/mobileLogin"
+public let kUserMobileLoginApi = "/user/mobileLogin"
 
 // MARK: - 绑定微信
 /// 绑定微信
-public let kUserBindWeixinApi = "user/bindWeixin"
+public let kUserBindWeixinApi = "/user/bindWeixin"
 
 // MARK: - 绑定手机号码
 /// 绑定手机号码
-public let kUserBindMobileApi = "user/bindMobile"
+public let kUserBindMobileApi = "/user/bindMobile"
 
 // MARK: - 设置密码
 /// 设置密码
-public let kUserSetPasswordApi = "user/SetPassword"
+public let kUserSetPasswordApi = "/user/SetPassword"
 
 
 

+ 2 - 7
RainbowPlanet/RainbowPlanet/Tools/AppInfo/AppInfo.swift

@@ -8,6 +8,7 @@
 
 import UIKit
 import KeychainAccess
+import DeviceKit
 
 struct  AppInfo {
     static let infoDictionary = Bundle.main.infoDictionary
@@ -31,17 +32,11 @@ struct  AppInfo {
     static let os_version = UIDevice.current.systemVersion
 
     /// 设备型号
-    static let device_name = UIDevice.current.model
-
-    /// 设备区域化型号
-    static let device_localized_name = UIDevice.current.localizedModel
+    static let device_name = Device()
 
     /// Bundle Identifier
     static let bundleIdentifier:String = Bundle.main.bundleIdentifier!
 
-    /// 设备唯一标示
-    static let identifierNumber = UIDevice.current.identifierForVendor //设备 UUID
-
 
     /// 获取app唯一标识(uuid+keychain 生成设备唯一标识)
     static var uuid :String {