SWIFT_VERSION = 4.0;
+ SWIFT_VERSION = 5.0;
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/**";
};
name = Release;
@@ -1,6 +1,6 @@ |
||
| 1 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 | 2 |
<Scheme |
| 3 |
- LastUpgradeVersion = "1010" |
|
| 3 |
+ LastUpgradeVersion = "1020" |
|
| 4 | 4 |
version = "1.3"> |
| 5 | 5 |
<BuildAction |
| 6 | 6 |
parallelizeBuildables = "YES" |
@@ -35,7 +35,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
|
||
| 35 | 35 |
var coordinator: AppCoordinator? |
| 36 | 36 |
|
| 37 | 37 |
func application(_ application: UIApplication, |
| 38 |
- didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) |
|
| 38 |
+ didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) |
|
| 39 | 39 |
-> Bool {
|
| 40 | 40 |
registerAppConfiguration() |
| 41 | 41 |
let rootViewController = ContainerViewController() |
@@ -50,12 +50,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
|
||
| 50 | 50 |
nav.navigationBar.tintColor = UIColor.white |
| 51 | 51 |
nav.navigationBar.isTranslucent = false |
| 52 | 52 |
nav.navigationBar.setBackgroundImage(UIImage.Navigation.background, for: .default) |
| 53 |
- nav.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor: UIColor.white.cgColor] |
|
| 53 |
+ nav.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white.cgColor] |
|
| 54 | 54 |
return true |
| 55 | 55 |
} |
| 56 | 56 |
|
| 57 | 57 |
func application(_ app: UIApplication, open url: URL, |
| 58 |
- options: [UIApplicationOpenURLOptionsKey: Any]) -> Bool {
|
|
| 58 |
+ options: [UIApplication.OpenURLOptionsKey: Any]) -> Bool {
|
|
| 59 | 59 |
var result: Bool = false |
| 60 | 60 |
#if !((arch(i386) || arch(x86_64))) |
| 61 | 61 |
switch sharedPlatform {
|
@@ -34,7 +34,7 @@ extension UserInfo: Mappable {
|
||
| 34 | 34 |
} |
| 35 | 35 |
|
| 36 | 36 |
mutating public func mapping(map: Map) {
|
| 37 |
- userName <- map["userName"] |
|
| 37 |
+ userName <- map["nickname"] |
|
| 38 | 38 |
userId <- map["user_id"] |
| 39 | 39 |
photoPath <- map["photoPath"] |
| 40 | 40 |
name <- map["name"] |
@@ -34,7 +34,6 @@ struct GroupPhotoRemoteAPI {
|
||
| 34 | 34 |
|
| 35 | 35 |
func uploadPhoto(data: Data) -> Single<[PhotoItem]> {
|
| 36 | 36 |
let name = ShareUserId + "\(Date.timeIntervalSinceReferenceDate)" |
| 37 |
- print(name) |
|
| 38 | 37 |
let file = FileModel(fileName: name, fileData: data) |
| 39 | 38 |
let uploadResource = UploadResource<[PhotoItem]>(path: .photoUpload, |
| 40 | 39 |
parameter: ["user_id": ShareUserId, |
@@ -11,28 +11,24 @@ import RxSwift |
||
| 11 | 11 |
|
| 12 | 12 |
struct GuestUserInfoRemoteAPI: UserInfoRemoteAPI {
|
| 13 | 13 |
|
| 14 |
- typealias Model = UserInfo |
|
| 15 |
- |
|
| 16 |
- var path: Interfaces { return .guestLogin }
|
|
| 17 |
- var parameter: Parameter = [:] |
|
| 18 |
- |
|
| 19 |
- init() {
|
|
| 20 |
- parameter = ["uuid": getUUID()] |
|
| 14 |
+ private func parse(_ json: JSON) -> UserInfo? {
|
|
| 15 |
+ guard let data = json["data"] as? [String: AnyObject] else { return nil }
|
|
| 16 |
+ return UserInfo(json: data) |
|
| 21 | 17 |
} |
| 22 | 18 |
|
| 23 | 19 |
func login() -> Single<UserInfo> {
|
| 24 |
- return Single.create(subscribe: { (observer) in
|
|
| 25 |
- observer(.success(UserInfo(json: ["user_id": "fiDz2Ms" as AnyObject, "userName": "郑剑飞" as AnyObject, "photoPath": "https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJibSYLgvXpMakvD9FaCqfiaWqcMiaiaz905YxWPuO4hy8F2lGheV7kVr9vKKXFgmL1S5s4QJgxwuwtVw/132" as AnyObject]))) |
|
| 26 |
- return Disposables.create() |
|
| 27 |
- }) |
|
| 20 |
+ let contentResource = ContentResource(path: .guestLogin, |
|
| 21 |
+ parameter: ["uuid": getUUID()], |
|
| 22 |
+ parseJSON: parse) |
|
| 23 |
+ return contentResource.loadContent() |
|
| 28 | 24 |
} |
| 29 | 25 |
|
| 30 | 26 |
func getUUID() -> String {
|
| 31 | 27 |
let keyChainDic = NSMutableDictionary() |
| 32 | 28 |
keyChainDic.setObject(String(kSecClassGenericPassword), forKey: kSecClass as! NSCopying) |
| 33 | 29 |
keyChainDic.setObject("uuid", forKey: kSecAttrAccount as! NSCopying)
|
| 34 |
- keyChainDic.setObject(kCFBooleanTrue, forKey: kSecReturnAttributes as! NSCopying) |
|
| 35 |
- keyChainDic.setObject(kCFBooleanTrue, forKey: kSecReturnData as! NSCopying) |
|
| 30 |
+ keyChainDic.setObject(kCFBooleanTrue as Any, forKey: kSecReturnAttributes as! NSCopying) |
|
| 31 |
+ keyChainDic.setObject(kCFBooleanTrue as Any, forKey: kSecReturnData as! NSCopying) |
|
| 36 | 32 |
|
| 37 | 33 |
var result: AnyObject? |
| 38 | 34 |
var uuid: String? = nil |
@@ -51,11 +47,3 @@ struct GuestUserInfoRemoteAPI: UserInfoRemoteAPI {
|
||
| 51 | 47 |
return uuidStr |
| 52 | 48 |
} |
| 53 | 49 |
} |
| 54 |
- |
|
| 55 |
-//extension GuestUserInfoRemoteAPI {
|
|
| 56 |
-// func parse(_ json: JSON) -> UserInfo? {
|
|
| 57 |
-// guard let result = json["data"] as? [String: AnyObject] else { return nil }
|
|
| 58 |
-// return UserInfo(json: result) |
|
| 59 |
-// } |
|
| 60 |
-// |
|
| 61 |
-//} |
@@ -45,6 +45,10 @@ class WXUserInfoRemoteAPI: UserInfoRemoteAPI {
|
||
| 45 | 45 |
} |
| 46 | 46 |
|
| 47 | 47 |
func login() -> Single<UserInfo> {
|
| 48 |
+ return Single.create(subscribe: { (observer) in
|
|
| 49 |
+ observer(.success(UserInfo(json: ["user_id": "fiDz2Ms" as AnyObject, "userName": "郑剑飞" as AnyObject, "photoPath": "https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJibSYLgvXpMakvD9FaCqfiaWqcMiaiaz905YxWPuO4hy8F2lGheV7kVr9vKKXFgmL1S5s4QJgxwuwtVw/132" as AnyObject]))) |
|
| 50 |
+ return Disposables.create() |
|
| 51 |
+ }) |
|
| 48 | 52 |
return Single.create(subscribe: { (observer) -> Disposable in
|
| 49 | 53 |
|
| 50 | 54 |
// let wxLoginObserver = self.addWXLoginDidFinish() |
@@ -177,7 +177,7 @@ fileprivate extension PageViewController {
|
||
| 177 | 177 |
setSliderViewDetail() |
| 178 | 178 |
} |
| 179 | 179 |
|
| 180 |
- fileprivate func setSliderViewDetail() {
|
|
| 180 |
+ func setSliderViewDetail() {
|
|
| 181 | 181 |
guard let label = menuView.viewWithTag(baseTag) else { return }
|
| 182 | 182 |
sliderConstraint = sliderView.centerXAnchor |
| 183 | 183 |
.constraint(equalTo: label.centerXAnchor) |