guest login

FFIB 6 ans auparavant
Parent
Commettre
8b679be38f

+ 16 - 17
PaiAi/Paiai.xcodeproj/project.pbxproj

@@ -1446,29 +1446,31 @@
1446 1446
 			isa = PBXProject;
1447 1447
 			attributes = {
1448 1448
 				LastSwiftUpdateCheck = 1010;
1449
-				LastUpgradeCheck = 1010;
1449
+				LastUpgradeCheck = 1020;
1450 1450
 				ORGANIZATIONNAME = yb;
1451 1451
 				TargetAttributes = {
1452 1452
 					05130F2D21C94B32004EF1BE = {
1453 1453
 						CreatedOnToolsVersion = 10.1;
1454 1454
 						DevelopmentTeam = Q38447SL4M;
1455
+						LastSwiftMigration = 1020;
1455 1456
 						ProvisioningStyle = Automatic;
1456 1457
 					};
1457 1458
 					05130F6921C95373004EF1BE = {
1458 1459
 						CreatedOnToolsVersion = 10.1;
1459 1460
 						DevelopmentTeam = Q38447SL4M;
1460
-						LastSwiftMigration = 1010;
1461
+						LastSwiftMigration = 1020;
1461 1462
 						ProvisioningStyle = Automatic;
1462 1463
 					};
1463 1464
 					05130F8D21C9E5E8004EF1BE = {
1464 1465
 						CreatedOnToolsVersion = 10.1;
1465 1466
 						DevelopmentTeam = Q38447SL4M;
1467
+						LastSwiftMigration = 1020;
1466 1468
 						ProvisioningStyle = Automatic;
1467 1469
 					};
1468 1470
 					6CEBD0FE1CA8D680004DBDE0 = {
1469 1471
 						CreatedOnToolsVersion = 7.3;
1470 1472
 						DevelopmentTeam = Q38447SL4M;
1471
-						LastSwiftMigration = 0900;
1473
+						LastSwiftMigration = 1020;
1472 1474
 						ProvisioningStyle = Automatic;
1473 1475
 						SystemCapabilities = {
1474 1476
 							com.apple.BackgroundModes = {
@@ -1486,10 +1488,9 @@
1486 1488
 			};
1487 1489
 			buildConfigurationList = 6CEBD0FA1CA8D680004DBDE0 /* Build configuration list for PBXProject "Paiai" */;
1488 1490
 			compatibilityVersion = "Xcode 3.2";
1489
-			developmentRegion = English;
1491
+			developmentRegion = en;
1490 1492
 			hasScannedForEncodings = 0;
1491 1493
 			knownRegions = (
1492
-				English,
1493 1494
 				en,
1494 1495
 				Base,
1495 1496
 				global,
@@ -1907,7 +1908,7 @@
1907 1908
 				PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
1908 1909
 				SKIP_INSTALL = YES;
1909 1910
 				SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
1910
-				SWIFT_VERSION = 4.2;
1911
+				SWIFT_VERSION = 5.0;
1911 1912
 				TARGETED_DEVICE_FAMILY = "1,2";
1912 1913
 				VERSIONING_SYSTEM = "apple-generic";
1913 1914
 				VERSION_INFO_PREFIX = "";
@@ -1941,7 +1942,7 @@
1941 1942
 				PRODUCT_BUNDLE_IDENTIFIER = FFIB.PaiaiUIKit;
1942 1943
 				PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
1943 1944
 				SKIP_INSTALL = YES;
1944
-				SWIFT_VERSION = 4.2;
1945
+				SWIFT_VERSION = 5.0;
1945 1946
 				TARGETED_DEVICE_FAMILY = "1,2";
1946 1947
 				VERSIONING_SYSTEM = "apple-generic";
1947 1948
 				VERSION_INFO_PREFIX = "";
@@ -1989,7 +1990,7 @@
1989 1990
 				SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
1990 1991
 				SWIFT_OBJC_BRIDGING_HEADER = "";
1991 1992
 				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
1992
-				SWIFT_VERSION = 4.2;
1993
+				SWIFT_VERSION = 5.0;
1993 1994
 				TARGETED_DEVICE_FAMILY = "1,2";
1994 1995
 				VERSIONING_SYSTEM = "apple-generic";
1995 1996
 				VERSION_INFO_PREFIX = "";
@@ -2035,7 +2036,7 @@
2035 2036
 				PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
2036 2037
 				SKIP_INSTALL = YES;
2037 2038
 				SWIFT_OBJC_BRIDGING_HEADER = "";
2038
-				SWIFT_VERSION = 4.2;
2039
+				SWIFT_VERSION = 5.0;
2039 2040
 				TARGETED_DEVICE_FAMILY = "1,2";
2040 2041
 				VERSIONING_SYSTEM = "apple-generic";
2041 2042
 				VERSION_INFO_PREFIX = "";
@@ -2050,7 +2051,7 @@
2050 2051
 				CLANG_ENABLE_OBJC_WEAK = YES;
2051 2052
 				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
2052 2053
 				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
2053
-				CODE_SIGN_IDENTITY = "iPhone Distribution: Beijing Jiayilai Trade Co., Ltd. (Q38447SL4M)";
2054
+				CODE_SIGN_IDENTITY = "";
2054 2055
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
2055 2056
 				CODE_SIGN_STYLE = Automatic;
2056 2057
 				CURRENT_PROJECT_VERSION = 1;
@@ -2074,7 +2075,7 @@
2074 2075
 				PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
2075 2076
 				SKIP_INSTALL = YES;
2076 2077
 				SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
2077
-				SWIFT_VERSION = 4.2;
2078
+				SWIFT_VERSION = 5.0;
2078 2079
 				TARGETED_DEVICE_FAMILY = "1,2";
2079 2080
 				VERSIONING_SYSTEM = "apple-generic";
2080 2081
 				VERSION_INFO_PREFIX = "";
@@ -2089,7 +2090,7 @@
2089 2090
 				CLANG_ENABLE_OBJC_WEAK = YES;
2090 2091
 				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
2091 2092
 				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
2092
-				CODE_SIGN_IDENTITY = "iPhone Distribution: Beijing Jiayilai Trade Co., Ltd. (Q38447SL4M)";
2093
+				CODE_SIGN_IDENTITY = "";
2093 2094
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
2094 2095
 				CODE_SIGN_STYLE = Automatic;
2095 2096
 				CURRENT_PROJECT_VERSION = 1;
@@ -2112,7 +2113,7 @@
2112 2113
 				PRODUCT_BUNDLE_IDENTIFIER = "com.Paiai-iOS";
2113 2114
 				PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
2114 2115
 				SKIP_INSTALL = YES;
2115
-				SWIFT_VERSION = 4.2;
2116
+				SWIFT_VERSION = 5.0;
2116 2117
 				TARGETED_DEVICE_FAMILY = "1,2";
2117 2118
 				VERSIONING_SYSTEM = "apple-generic";
2118 2119
 				VERSION_INFO_PREFIX = "";
@@ -2277,8 +2278,7 @@
2277 2278
 				PROVISIONING_PROFILE = "";
2278 2279
 				PROVISIONING_PROFILE_SPECIFIER = "";
2279 2280
 				SWIFT_OBJC_BRIDGING_HEADER = "Swift-bridge.h";
2280
-				SWIFT_SWIFT3_OBJC_INFERENCE = Default;
2281
-				SWIFT_VERSION = 4.0;
2281
+				SWIFT_VERSION = 5.0;
2282 2282
 				USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/**";
2283 2283
 			};
2284 2284
 			name = Debug;
@@ -2324,8 +2324,7 @@
2324 2324
 				PROVISIONING_PROFILE = "";
2325 2325
 				PROVISIONING_PROFILE_SPECIFIER = "";
2326 2326
 				SWIFT_OBJC_BRIDGING_HEADER = "Swift-bridge.h";
2327
-				SWIFT_SWIFT3_OBJC_INFERENCE = Default;
2328
-				SWIFT_VERSION = 4.0;
2327
+				SWIFT_VERSION = 5.0;
2329 2328
 				USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/**";
2330 2329
 			};
2331 2330
 			name = Release;

BIN
PaiAi/Paiai.xcodeproj/project.xcworkspace/xcuserdata/FFIB.xcuserdatad/UserInterfaceState.xcuserstate


+ 1 - 1
PaiAi/Paiai.xcodeproj/xcuserdata/FFIB.xcuserdatad/xcschemes/PaiAi.xcscheme

@@ -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"

+ 3 - 3
PaiAi/Paiai/AppDelegate.swift

@@ -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 {

+ 1 - 1
PaiAi/PaiaiDataKit/DataLayer/Model/UserInfo.swift

@@ -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"]

+ 0 - 1
PaiAi/PaiaiDataKit/DataLayer/Repositories/Remote/GroupPhotoRemoteAPI.swift

@@ -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,

+ 9 - 21
PaiAi/PaiaiDataKit/DataLayer/Repositories/Remote/GuestUserInfoRemoteAPI.swift

@@ -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
-//}

+ 4 - 0
PaiAi/PaiaiDataKit/DataLayer/Repositories/Remote/WXUserInfoRemoteAPI.swift

@@ -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()

+ 1 - 1
PaiAi/PaiaiUIKit/Reusable/UIKit/PageViewController/PageViewController.swift

@@ -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)