login done, optimize network

FFIB 6 anos atrás
pai
commit
8e61d77f3f

+ 90 - 60
PaiAi/Paiai.xcodeproj/project.pbxproj

@@ -22,8 +22,23 @@
22 22
 		0505AD0B21DF348F00404071 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 0505ACFC21DF106E00404071 /* libc++.tbd */; };
23 23
 		0505AD0C21DF34B600404071 /* libsqlite3.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 0505ACFA21DF106000404071 /* libsqlite3.0.tbd */; };
24 24
 		0505AD0D21DF34E100404071 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0505AD0021DF107D00404071 /* CoreTelephony.framework */; };
25
+		050D717E2253162C0076CE06 /* RxDataSources.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05130FC421CA1997004EF1BE /* RxDataSources.framework */; };
26
+		050D7181225317AD0076CE06 /* PaiaiUIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05130F2E21C94B32004EF1BE /* PaiaiUIKit.framework */; };
27
+		050D7182225317AD0076CE06 /* PaiaiUIKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 05130F2E21C94B32004EF1BE /* PaiaiUIKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
28
+		050D7183225317AD0076CE06 /* PaiaiDataKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05130F6A21C95373004EF1BE /* PaiaiDataKit.framework */; };
29
+		050D7184225317AD0076CE06 /* PaiaiDataKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 05130F6A21C95373004EF1BE /* PaiaiDataKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
30
+		050D7187225317AD0076CE06 /* Paiai_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05130F8E21C9E5E8004EF1BE /* Paiai_iOS.framework */; };
31
+		050D7188225317AD0076CE06 /* Paiai_iOS.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 05130F8E21C9E5E8004EF1BE /* Paiai_iOS.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
32
+		050D718E22531AF40076CE06 /* RxDataSources.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 050D718D22531AF40076CE06 /* RxDataSources.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
33
+		050D719022531B180076CE06 /* Kingfisher.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 050D718F22531B180076CE06 /* Kingfisher.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
34
+		050D719222531B360076CE06 /* Alamofire.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 050D719122531B360076CE06 /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
35
+		050D719522531B520076CE06 /* ObjectMapper.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 050D719422531B520076CE06 /* ObjectMapper.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
36
+		050D719722531B650076CE06 /* PullToRefresh.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 050D719622531B650076CE06 /* PullToRefresh.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
37
+		050D719922531B780076CE06 /* RxCocoa.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 050D719822531B780076CE06 /* RxCocoa.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
38
+		050D719B22531B860076CE06 /* RxSwift.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 050D719A22531B860076CE06 /* RxSwift.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
39
+		050D719D22531BA60076CE06 /* SQLite.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 050D719C22531BA60076CE06 /* SQLite.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
40
+		050D719E22531BBF0076CE06 /* Differentiator.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 05130FBD21CA194B004EF1BE /* Differentiator.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
25 41
 		05130F4021C94B33004EF1BE /* PaiaiUIKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 05130F3021C94B32004EF1BE /* PaiaiUIKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
26
-		05130F4321C94B33004EF1BE /* PaiaiUIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05130F2E21C94B32004EF1BE /* PaiaiUIKit.framework */; };
27 42
 		05130F5721C94C12004EF1BE /* AlertAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05130F4F21C94C12004EF1BE /* AlertAnimator.swift */; };
28 43
 		05130F5921C94C12004EF1BE /* AlertViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05130F5121C94C12004EF1BE /* AlertViewController.swift */; };
29 44
 		05130F5A21C94C12004EF1BE /* PresentDisappearAnimatedTransitioning.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05130F5221C94C12004EF1BE /* PresentDisappearAnimatedTransitioning.swift */; };
@@ -33,16 +48,11 @@
33 48
 		05130F6321C94C7A004EF1BE /* SideViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05130F6021C94C79004EF1BE /* SideViewController.swift */; };
34 49
 		05130F6421C94C7A004EF1BE /* PageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05130F6221C94C79004EF1BE /* PageViewController.swift */; };
35 50
 		05130F7C21C95373004EF1BE /* PaiaiDataKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 05130F6C21C95373004EF1BE /* PaiaiDataKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
36
-		05130F7F21C95373004EF1BE /* PaiaiDataKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05130F6A21C95373004EF1BE /* PaiaiDataKit.framework */; };
37
-		05130F8021C95373004EF1BE /* PaiaiDataKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 05130F6A21C95373004EF1BE /* PaiaiDataKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
38 51
 		05130FA021C9E5E9004EF1BE /* Paiai_iOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 05130F9021C9E5E8004EF1BE /* Paiai_iOS.h */; settings = {ATTRIBUTES = (Public, ); }; };
39
-		05130FA321C9E5E9004EF1BE /* Paiai_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05130F8E21C9E5E8004EF1BE /* Paiai_iOS.framework */; };
40
-		05130FA421C9E5E9004EF1BE /* Paiai_iOS.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 05130F8E21C9E5E8004EF1BE /* Paiai_iOS.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
41 52
 		05130FB021C9E6CD004EF1BE /* OrderItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05130FAF21C9E6CD004EF1BE /* OrderItem.swift */; };
42 53
 		05130FB321C9E76A004EF1BE /* GroupItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05130FB221C9E76A004EF1BE /* GroupItem.swift */; };
43 54
 		05130FB521C9E7CE004EF1BE /* MessageItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05130FB421C9E7CE004EF1BE /* MessageItem.swift */; };
44 55
 		05130FB721C9E80F004EF1BE /* MessageListItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05130FB621C9E80F004EF1BE /* MessageListItem.swift */; };
45
-		05130FBC21C9F708004EF1BE /* Cartfile in Resources */ = {isa = PBXBuildFile; fileRef = 05130FBB21C9F707004EF1BE /* Cartfile */; };
46 56
 		05130FD221CA1A8A004EF1BE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CEBD1021CA8D680004DBDE0 /* AppDelegate.swift */; };
47 57
 		05130FD321CA1AD4004EF1BE /* PhotoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 054863661FA326CB00A39DA0 /* PhotoCell.swift */; };
48 58
 		05130FD421CA1AD4004EF1BE /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A69FFA791E7002970006FEE0 /* LoginViewController.swift */; };
@@ -153,7 +163,6 @@
153 163
 		0513109C21CA4103004EF1BE /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0513106121CA22B5004EF1BE /* Alamofire.framework */; };
154 164
 		0513109F21CA4103004EF1BE /* ObjectMapper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05130FC921CA1997004EF1BE /* ObjectMapper.framework */; };
155 165
 		051310A221CA4103004EF1BE /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05130FC221CA1997004EF1BE /* RxCocoa.framework */; };
156
-		051310A321CA4103004EF1BE /* RxDataSources.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05130FC421CA1997004EF1BE /* RxDataSources.framework */; };
157 166
 		051310A421CA4103004EF1BE /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05130FC321CA1997004EF1BE /* RxSwift.framework */; };
158 167
 		051310A621CA4103004EF1BE /* SQLite.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05130FC821CA1997004EF1BE /* SQLite.framework */; };
159 168
 		051310B421CB5EC3004EF1BE /* Kingfisher.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 051310B321CB5EC3004EF1BE /* Kingfisher.framework */; };
@@ -176,7 +185,6 @@
176 185
 		0543E80F21D1FD1100A42807 /* GroupDetailItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0543E80E21D1FD1100A42807 /* GroupDetailItem.swift */; };
177 186
 		0546D9852242460700742939 /* OriginData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0546D9842242460700742939 /* OriginData.swift */; };
178 187
 		054B6C45223F884600939FE6 /* PhotoDetailRemoteAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 054B6C44223F884600939FE6 /* PhotoDetailRemoteAPI.swift */; };
179
-		054B6C46223F966A00939FE6 /* RxDataSources.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 05130FC421CA1997004EF1BE /* RxDataSources.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
180 188
 		05594BFF2240BEDE002D4910 /* PhotoDetailViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05594BFE2240BEDE002D4910 /* PhotoDetailViewModel.swift */; };
181 189
 		05594C012240BF9C002D4910 /* PhotoPurchaseViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05594C002240BF9C002D4910 /* PhotoPurchaseViewModel.swift */; };
182 190
 		05594C032240E94E002D4910 /* PhotoDetailImageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05594C022240E94E002D4910 /* PhotoDetailImageCell.swift */; };
@@ -186,8 +194,6 @@
186 194
 		0569F6152200438C000A75CA /* Group.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0569F613220042AF000A75CA /* Group.storyboard */; };
187 195
 		0569F61822014B24000A75CA /* NavigationBarDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0569F61722014B24000A75CA /* NavigationBarDelegate.swift */; };
188 196
 		0569F61A22014B30000A75CA /* NavigationBarProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0569F61922014B30000A75CA /* NavigationBarProxy.swift */; };
189
-		0572B2C121E2FB3E00EAD2A2 /* README.txt in Resources */ = {isa = PBXBuildFile; fileRef = 0572B2BC21E2FB3C00EAD2A2 /* README.txt */; };
190
-		0572B2C221E2FB3E00EAD2A2 /* README.txt in Resources */ = {isa = PBXBuildFile; fileRef = 0572B2BC21E2FB3C00EAD2A2 /* README.txt */; };
191 197
 		0572B2C321E2FB3E00EAD2A2 /* WXApiObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 0572B2BD21E2FB3C00EAD2A2 /* WXApiObject.h */; settings = {ATTRIBUTES = (Public, ); }; };
192 198
 		0572B2C421E2FB3E00EAD2A2 /* WechatAuthSDK.h in Headers */ = {isa = PBXBuildFile; fileRef = 0572B2BE21E2FB3D00EAD2A2 /* WechatAuthSDK.h */; settings = {ATTRIBUTES = (Public, ); }; };
193 199
 		0572B2C621E2FB3E00EAD2A2 /* libWeChatSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0572B2BF21E2FB3D00EAD2A2 /* libWeChatSDK.a */; };
@@ -256,27 +262,27 @@
256 262
 /* End PBXBuildFile section */
257 263
 
258 264
 /* Begin PBXContainerItemProxy section */
259
-		05130F4121C94B33004EF1BE /* PBXContainerItemProxy */ = {
260
-			isa = PBXContainerItemProxy;
261
-			containerPortal = 6CEBD0F71CA8D680004DBDE0 /* Project object */;
262
-			proxyType = 1;
263
-			remoteGlobalIDString = 05130F2D21C94B32004EF1BE;
264
-			remoteInfo = PaiaiUIKit;
265
-		};
266
-		05130F7D21C95373004EF1BE /* PBXContainerItemProxy */ = {
265
+		050D7185225317AD0076CE06 /* PBXContainerItemProxy */ = {
267 266
 			isa = PBXContainerItemProxy;
268 267
 			containerPortal = 6CEBD0F71CA8D680004DBDE0 /* Project object */;
269 268
 			proxyType = 1;
270 269
 			remoteGlobalIDString = 05130F6921C95373004EF1BE;
271 270
 			remoteInfo = PaiaiDataKit;
272 271
 		};
273
-		05130FA121C9E5E9004EF1BE /* PBXContainerItemProxy */ = {
272
+		050D7189225317AD0076CE06 /* PBXContainerItemProxy */ = {
274 273
 			isa = PBXContainerItemProxy;
275 274
 			containerPortal = 6CEBD0F71CA8D680004DBDE0 /* Project object */;
276 275
 			proxyType = 1;
277 276
 			remoteGlobalIDString = 05130F8D21C9E5E8004EF1BE;
278 277
 			remoteInfo = Paiai_iOS;
279 278
 		};
279
+		05130F4121C94B33004EF1BE /* PBXContainerItemProxy */ = {
280
+			isa = PBXContainerItemProxy;
281
+			containerPortal = 6CEBD0F71CA8D680004DBDE0 /* Project object */;
282
+			proxyType = 1;
283
+			remoteGlobalIDString = 05130F2D21C94B32004EF1BE;
284
+			remoteInfo = PaiaiUIKit;
285
+		};
280 286
 		051310A721CA451B004EF1BE /* PBXContainerItemProxy */ = {
281 287
 			isa = PBXContainerItemProxy;
282 288
 			containerPortal = 6CEBD0F71CA8D680004DBDE0 /* Project object */;
@@ -294,18 +300,27 @@
294 300
 /* End PBXContainerItemProxy section */
295 301
 
296 302
 /* Begin PBXCopyFilesBuildPhase section */
297
-		05130F4821C94B33004EF1BE /* Embed Frameworks */ = {
303
+		050D718B225317AD0076CE06 /* Embed Frameworks */ = {
298 304
 			isa = PBXCopyFilesBuildPhase;
299
-			buildActionMask = 8;
305
+			buildActionMask = 2147483647;
300 306
 			dstPath = "";
301 307
 			dstSubfolderSpec = 10;
302 308
 			files = (
303
-				054B6C46223F966A00939FE6 /* RxDataSources.framework in Embed Frameworks */,
304
-				05130F8021C95373004EF1BE /* PaiaiDataKit.framework in Embed Frameworks */,
305
-				05130FA421C9E5E9004EF1BE /* Paiai_iOS.framework in Embed Frameworks */,
309
+				050D719E22531BBF0076CE06 /* Differentiator.framework in Embed Frameworks */,
310
+				050D719D22531BA60076CE06 /* SQLite.framework in Embed Frameworks */,
311
+				050D719B22531B860076CE06 /* RxSwift.framework in Embed Frameworks */,
312
+				050D719922531B780076CE06 /* RxCocoa.framework in Embed Frameworks */,
313
+				050D719722531B650076CE06 /* PullToRefresh.framework in Embed Frameworks */,
314
+				050D719522531B520076CE06 /* ObjectMapper.framework in Embed Frameworks */,
315
+				050D719022531B180076CE06 /* Kingfisher.framework in Embed Frameworks */,
316
+				050D719222531B360076CE06 /* Alamofire.framework in Embed Frameworks */,
317
+				050D718E22531AF40076CE06 /* RxDataSources.framework in Embed Frameworks */,
318
+				050D7184225317AD0076CE06 /* PaiaiDataKit.framework in Embed Frameworks */,
319
+				050D7188225317AD0076CE06 /* Paiai_iOS.framework in Embed Frameworks */,
320
+				050D7182225317AD0076CE06 /* PaiaiUIKit.framework in Embed Frameworks */,
306 321
 			);
307 322
 			name = "Embed Frameworks";
308
-			runOnlyForDeploymentPostprocessing = 1;
323
+			runOnlyForDeploymentPostprocessing = 0;
309 324
 		};
310 325
 /* End PBXCopyFilesBuildPhase section */
311 326
 
@@ -323,6 +338,15 @@
323 338
 		0505B34F1F7E4B9A009E4ED2 /* NetworkApi.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkApi.swift; sourceTree = "<group>"; };
324 339
 		0506441E1F8D09C00035857E /* StatusModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusModel.swift; sourceTree = "<group>"; };
325 340
 		05087F6721B8F9530024A117 /* ContainerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContainerViewController.swift; sourceTree = "<group>"; };
341
+		050D718D22531AF40076CE06 /* RxDataSources.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxDataSources.framework; path = Carthage/Build/iOS/RxDataSources.framework; sourceTree = "<group>"; };
342
+		050D718F22531B180076CE06 /* Kingfisher.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Kingfisher.framework; path = Carthage/Build/iOS/Kingfisher.framework; sourceTree = "<group>"; };
343
+		050D719122531B360076CE06 /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = Carthage/Build/iOS/Alamofire.framework; sourceTree = "<group>"; };
344
+		050D719322531B440076CE06 /* Kingfisher.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Kingfisher.framework; path = Carthage/Build/iOS/Kingfisher.framework; sourceTree = "<group>"; };
345
+		050D719422531B520076CE06 /* ObjectMapper.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ObjectMapper.framework; path = Carthage/Build/iOS/ObjectMapper.framework; sourceTree = "<group>"; };
346
+		050D719622531B650076CE06 /* PullToRefresh.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PullToRefresh.framework; path = Carthage/Build/iOS/PullToRefresh.framework; sourceTree = "<group>"; };
347
+		050D719822531B780076CE06 /* RxCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxCocoa.framework; path = Carthage/Build/iOS/RxCocoa.framework; sourceTree = "<group>"; };
348
+		050D719A22531B860076CE06 /* RxSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxSwift.framework; path = Carthage/Build/iOS/RxSwift.framework; sourceTree = "<group>"; };
349
+		050D719C22531BA60076CE06 /* SQLite.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SQLite.framework; path = Carthage/Build/iOS/SQLite.framework; sourceTree = "<group>"; };
326 350
 		050E210F21B8CE8A008E1352 /* AppCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppCoordinator.swift; sourceTree = "<group>"; };
327 351
 		050E211121B8F2D4008E1352 /* HomeCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeCoordinator.swift; sourceTree = "<group>"; };
328 352
 		050E211321B8F39C008E1352 /* MineCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MineCoordinator.swift; sourceTree = "<group>"; };
@@ -353,7 +377,6 @@
353 377
 		05130FB621C9E80F004EF1BE /* MessageListItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageListItem.swift; sourceTree = "<group>"; };
354 378
 		05130FBB21C9F707004EF1BE /* Cartfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cartfile; sourceTree = "<group>"; };
355 379
 		05130FBD21CA194B004EF1BE /* Differentiator.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Differentiator.framework; path = Carthage/Build/iOS/Differentiator.framework; sourceTree = "<group>"; };
356
-		05130FC021CA196F004EF1BE /* ESPullToRefresh.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ESPullToRefresh.framework; path = Carthage/Build/iOS/ESPullToRefresh.framework; sourceTree = "<group>"; };
357 380
 		05130FC221CA1997004EF1BE /* RxCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxCocoa.framework; path = Carthage/Build/iOS/RxCocoa.framework; sourceTree = "<group>"; };
358 381
 		05130FC321CA1997004EF1BE /* RxSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxSwift.framework; path = Carthage/Build/iOS/RxSwift.framework; sourceTree = "<group>"; };
359 382
 		05130FC421CA1997004EF1BE /* RxDataSources.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxDataSources.framework; path = Carthage/Build/iOS/RxDataSources.framework; sourceTree = "<group>"; };
@@ -596,23 +619,23 @@
596 619
 			isa = PBXFrameworksBuildPhase;
597 620
 			buildActionMask = 2147483647;
598 621
 			files = (
622
+				050D717E2253162C0076CE06 /* RxDataSources.framework in Frameworks */,
599 623
 				0505AD0D21DF34E100404071 /* CoreTelephony.framework in Frameworks */,
600 624
 				0505AD0C21DF34B600404071 /* libsqlite3.0.tbd in Frameworks */,
601 625
 				0505AD0B21DF348F00404071 /* libc++.tbd in Frameworks */,
602 626
 				0505AD0A21DF347400404071 /* CFNetwork.framework in Frameworks */,
627
+				050D7187225317AD0076CE06 /* Paiai_iOS.framework in Frameworks */,
603 628
 				0505AD0921DF345E00404071 /* Security.framework in Frameworks */,
604 629
 				0505AD0621DF342F00404071 /* libz.tbd in Frameworks */,
630
+				050D7181225317AD0076CE06 /* PaiaiUIKit.framework in Frameworks */,
631
+				050D7183225317AD0076CE06 /* PaiaiDataKit.framework in Frameworks */,
605 632
 				051310B421CB5EC3004EF1BE /* Kingfisher.framework in Frameworks */,
606 633
 				052BF1C821E344020010D270 /* PullToRefresh.framework in Frameworks */,
607 634
 				0513109C21CA4103004EF1BE /* Alamofire.framework in Frameworks */,
608 635
 				0513109F21CA4103004EF1BE /* ObjectMapper.framework in Frameworks */,
609 636
 				051310A221CA4103004EF1BE /* RxCocoa.framework in Frameworks */,
610
-				051310A321CA4103004EF1BE /* RxDataSources.framework in Frameworks */,
611 637
 				051310A421CA4103004EF1BE /* RxSwift.framework in Frameworks */,
612 638
 				051310A621CA4103004EF1BE /* SQLite.framework in Frameworks */,
613
-				05130FA321C9E5E9004EF1BE /* Paiai_iOS.framework in Frameworks */,
614
-				05130F4321C94B33004EF1BE /* PaiaiUIKit.framework in Frameworks */,
615
-				05130F7F21C95373004EF1BE /* PaiaiDataKit.framework in Frameworks */,
616 639
 			);
617 640
 			runOnlyForDeploymentPostprocessing = 0;
618 641
 		};
@@ -1251,6 +1274,15 @@
1251 1274
 		6CEBD0F61CA8D680004DBDE0 = {
1252 1275
 			isa = PBXGroup;
1253 1276
 			children = (
1277
+				050D719C22531BA60076CE06 /* SQLite.framework */,
1278
+				050D719A22531B860076CE06 /* RxSwift.framework */,
1279
+				050D719822531B780076CE06 /* RxCocoa.framework */,
1280
+				050D719622531B650076CE06 /* PullToRefresh.framework */,
1281
+				050D719422531B520076CE06 /* ObjectMapper.framework */,
1282
+				050D719322531B440076CE06 /* Kingfisher.framework */,
1283
+				050D719122531B360076CE06 /* Alamofire.framework */,
1284
+				050D718F22531B180076CE06 /* Kingfisher.framework */,
1285
+				050D718D22531AF40076CE06 /* RxDataSources.framework */,
1254 1286
 				05130FBB21C9F707004EF1BE /* Cartfile */,
1255 1287
 				3864C06C1CAD27EC0048ADAD /* Swift-bridge.h */,
1256 1288
 				6CEBD1011CA8D680004DBDE0 /* Paiai */,
@@ -1308,7 +1340,6 @@
1308 1340
 				05130FC321CA1997004EF1BE /* RxSwift.framework */,
1309 1341
 				05130FC721CA1997004EF1BE /* RxTest.framework */,
1310 1342
 				05130FC821CA1997004EF1BE /* SQLite.framework */,
1311
-				05130FC021CA196F004EF1BE /* ESPullToRefresh.framework */,
1312 1343
 				05130FBD21CA194B004EF1BE /* Differentiator.framework */,
1313 1344
 			);
1314 1345
 			name = Frameworks;
@@ -1431,14 +1462,14 @@
1431 1462
 				6CEBD0FC1CA8D680004DBDE0 /* Frameworks */,
1432 1463
 				6CEBD0FD1CA8D680004DBDE0 /* Resources */,
1433 1464
 				05D5F0C22015E55000BC890B /* Run Script */,
1434
-				05130F4821C94B33004EF1BE /* Embed Frameworks */,
1465
+				050D718B225317AD0076CE06 /* Embed Frameworks */,
1435 1466
 			);
1436 1467
 			buildRules = (
1437 1468
 			);
1438 1469
 			dependencies = (
1439 1470
 				05130F4221C94B33004EF1BE /* PBXTargetDependency */,
1440
-				05130F7E21C95373004EF1BE /* PBXTargetDependency */,
1441
-				05130FA221C9E5E9004EF1BE /* PBXTargetDependency */,
1471
+				050D7186225317AD0076CE06 /* PBXTargetDependency */,
1472
+				050D718A225317AD0076CE06 /* PBXTargetDependency */,
1442 1473
 			);
1443 1474
 			name = Paiai;
1444 1475
 			productName = PaiAi;
@@ -1527,7 +1558,6 @@
1527 1558
 			isa = PBXResourcesBuildPhase;
1528 1559
 			buildActionMask = 2147483647;
1529 1560
 			files = (
1530
-				0572B2C221E2FB3E00EAD2A2 /* README.txt in Resources */,
1531 1561
 			);
1532 1562
 			runOnlyForDeploymentPostprocessing = 0;
1533 1563
 		};
@@ -1550,9 +1580,7 @@
1550 1580
 			isa = PBXResourcesBuildPhase;
1551 1581
 			buildActionMask = 2147483647;
1552 1582
 			files = (
1553
-				05130FBC21C9F708004EF1BE /* Cartfile in Resources */,
1554 1583
 				05E80E3021DF65D5006368C4 /* Assets.xcassets in Resources */,
1555
-				0572B2C121E2FB3E00EAD2A2 /* README.txt in Resources */,
1556 1584
 			);
1557 1585
 			runOnlyForDeploymentPostprocessing = 0;
1558 1586
 		};
@@ -1561,7 +1589,7 @@
1561 1589
 /* Begin PBXShellScriptBuildPhase section */
1562 1590
 		05D5F0C22015E55000BC890B /* Run Script */ = {
1563 1591
 			isa = PBXShellScriptBuildPhase;
1564
-			buildActionMask = 12;
1592
+			buildActionMask = 8;
1565 1593
 			files = (
1566 1594
 			);
1567 1595
 			inputPaths = (
@@ -1585,7 +1613,7 @@
1585 1613
 				"$(DERIVED_FILE_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Kingfisher.framework",
1586 1614
 				"$(DERIVED_FILE_DIR)/$(FRAMEWORKS_FOLDER_PATH)/PullToRefresh.framework",
1587 1615
 			);
1588
-			runOnlyForDeploymentPostprocessing = 0;
1616
+			runOnlyForDeploymentPostprocessing = 1;
1589 1617
 			shellPath = /bin/sh;
1590 1618
 			shellScript = "/usr/local/bin/carthage copy-frameworks\n";
1591 1619
 		};
@@ -1809,20 +1837,20 @@
1809 1837
 /* End PBXSourcesBuildPhase section */
1810 1838
 
1811 1839
 /* Begin PBXTargetDependency section */
1812
-		05130F4221C94B33004EF1BE /* PBXTargetDependency */ = {
1813
-			isa = PBXTargetDependency;
1814
-			target = 05130F2D21C94B32004EF1BE /* PaiaiUIKit */;
1815
-			targetProxy = 05130F4121C94B33004EF1BE /* PBXContainerItemProxy */;
1816
-		};
1817
-		05130F7E21C95373004EF1BE /* PBXTargetDependency */ = {
1840
+		050D7186225317AD0076CE06 /* PBXTargetDependency */ = {
1818 1841
 			isa = PBXTargetDependency;
1819 1842
 			target = 05130F6921C95373004EF1BE /* PaiaiDataKit */;
1820
-			targetProxy = 05130F7D21C95373004EF1BE /* PBXContainerItemProxy */;
1843
+			targetProxy = 050D7185225317AD0076CE06 /* PBXContainerItemProxy */;
1821 1844
 		};
1822
-		05130FA221C9E5E9004EF1BE /* PBXTargetDependency */ = {
1845
+		050D718A225317AD0076CE06 /* PBXTargetDependency */ = {
1823 1846
 			isa = PBXTargetDependency;
1824 1847
 			target = 05130F8D21C9E5E8004EF1BE /* Paiai_iOS */;
1825
-			targetProxy = 05130FA121C9E5E9004EF1BE /* PBXContainerItemProxy */;
1848
+			targetProxy = 050D7189225317AD0076CE06 /* PBXContainerItemProxy */;
1849
+		};
1850
+		05130F4221C94B33004EF1BE /* PBXTargetDependency */ = {
1851
+			isa = PBXTargetDependency;
1852
+			target = 05130F2D21C94B32004EF1BE /* PaiaiUIKit */;
1853
+			targetProxy = 05130F4121C94B33004EF1BE /* PBXContainerItemProxy */;
1826 1854
 		};
1827 1855
 		051310A821CA451B004EF1BE /* PBXTargetDependency */ = {
1828 1856
 			isa = PBXTargetDependency;
@@ -1896,7 +1924,7 @@
1896 1924
 				CLANG_ENABLE_OBJC_WEAK = YES;
1897 1925
 				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
1898 1926
 				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
1899
-				CODE_SIGN_IDENTITY = "";
1927
+				CODE_SIGN_IDENTITY = "iPhone Developer";
1900 1928
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1901 1929
 				CODE_SIGN_STYLE = Automatic;
1902 1930
 				CURRENT_PROJECT_VERSION = 1;
@@ -1931,7 +1959,7 @@
1931 1959
 				CLANG_ENABLE_OBJC_WEAK = YES;
1932 1960
 				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
1933 1961
 				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
1934
-				CODE_SIGN_IDENTITY = "";
1962
+				CODE_SIGN_IDENTITY = "iPhone Developer";
1935 1963
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1936 1964
 				CODE_SIGN_STYLE = Automatic;
1937 1965
 				CURRENT_PROJECT_VERSION = 1;
@@ -1967,7 +1995,7 @@
1967 1995
 				CLANG_ENABLE_OBJC_WEAK = YES;
1968 1996
 				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
1969 1997
 				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
1970
-				CODE_SIGN_IDENTITY = "";
1998
+				CODE_SIGN_IDENTITY = "iPhone Developer";
1971 1999
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1972 2000
 				CODE_SIGN_STYLE = Automatic;
1973 2001
 				CURRENT_PROJECT_VERSION = 1;
@@ -2015,7 +2043,7 @@
2015 2043
 				CLANG_ENABLE_OBJC_WEAK = YES;
2016 2044
 				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
2017 2045
 				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
2018
-				CODE_SIGN_IDENTITY = "";
2046
+				CODE_SIGN_IDENTITY = "iPhone Developer";
2019 2047
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
2020 2048
 				CODE_SIGN_STYLE = Automatic;
2021 2049
 				CURRENT_PROJECT_VERSION = 1;
@@ -2059,7 +2087,7 @@
2059 2087
 				CLANG_ENABLE_OBJC_WEAK = YES;
2060 2088
 				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
2061 2089
 				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
2062
-				CODE_SIGN_IDENTITY = "";
2090
+				CODE_SIGN_IDENTITY = "iPhone Developer";
2063 2091
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
2064 2092
 				CODE_SIGN_STYLE = Automatic;
2065 2093
 				CURRENT_PROJECT_VERSION = 1;
@@ -2084,7 +2112,7 @@
2084 2112
 				SKIP_INSTALL = YES;
2085 2113
 				SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
2086 2114
 				SWIFT_VERSION = 5.0;
2087
-				TARGETED_DEVICE_FAMILY = "1,2";
2115
+				TARGETED_DEVICE_FAMILY = 1;
2088 2116
 				VERSIONING_SYSTEM = "apple-generic";
2089 2117
 				VERSION_INFO_PREFIX = "";
2090 2118
 			};
@@ -2098,7 +2126,7 @@
2098 2126
 				CLANG_ENABLE_OBJC_WEAK = YES;
2099 2127
 				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
2100 2128
 				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
2101
-				CODE_SIGN_IDENTITY = "";
2129
+				CODE_SIGN_IDENTITY = "iPhone Developer";
2102 2130
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
2103 2131
 				CODE_SIGN_STYLE = Automatic;
2104 2132
 				CURRENT_PROJECT_VERSION = 1;
@@ -2122,7 +2150,7 @@
2122 2150
 				PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
2123 2151
 				SKIP_INSTALL = YES;
2124 2152
 				SWIFT_VERSION = 5.0;
2125
-				TARGETED_DEVICE_FAMILY = "1,2";
2153
+				TARGETED_DEVICE_FAMILY = 1;
2126 2154
 				VERSIONING_SYSTEM = "apple-generic";
2127 2155
 				VERSION_INFO_PREFIX = "";
2128 2156
 			};
@@ -2247,14 +2275,15 @@
2247 2275
 		6CEBD1121CA8D680004DBDE0 /* Debug */ = {
2248 2276
 			isa = XCBuildConfiguration;
2249 2277
 			buildSettings = {
2250
-				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
2278
+				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
2251 2279
 				ALWAYS_SEARCH_USER_PATHS = NO;
2252 2280
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
2253 2281
 				CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
2254 2282
 				CLANG_ENABLE_MODULES = NO;
2255 2283
 				CODE_SIGN_ENTITLEMENTS = PaiAi/PaiAi.entitlements;
2256
-				CODE_SIGN_IDENTITY = "iPhone Distribution: Beijing Jiayilai Trade Co., Ltd. (Q38447SL4M)";
2284
+				CODE_SIGN_IDENTITY = "iPhone Developer";
2257 2285
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
2286
+				CODE_SIGN_STYLE = Automatic;
2258 2287
 				DEFINES_MODULE = YES;
2259 2288
 				DEVELOPMENT_TEAM = Q38447SL4M;
2260 2289
 				ENABLE_BITCODE = NO;
@@ -2294,14 +2323,15 @@
2294 2323
 		6CEBD1131CA8D680004DBDE0 /* Release */ = {
2295 2324
 			isa = XCBuildConfiguration;
2296 2325
 			buildSettings = {
2297
-				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
2326
+				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
2298 2327
 				ALWAYS_SEARCH_USER_PATHS = NO;
2299 2328
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
2300 2329
 				CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
2301 2330
 				CLANG_ENABLE_MODULES = NO;
2302 2331
 				CODE_SIGN_ENTITLEMENTS = PaiAi/PaiAi.entitlements;
2303
-				CODE_SIGN_IDENTITY = "iPhone Distribution: Beijing Jiayilai Trade Co., Ltd. (Q38447SL4M)";
2332
+				CODE_SIGN_IDENTITY = "iPhone Developer";
2304 2333
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
2334
+				CODE_SIGN_STYLE = Automatic;
2305 2335
 				DEBUG_INFORMATION_FORMAT = dwarf;
2306 2336
 				DEFINES_MODULE = YES;
2307 2337
 				DEVELOPMENT_TEAM = Q38447SL4M;

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


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

@@ -1,7 +1,7 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <Scheme
3 3
    LastUpgradeVersion = "1020"
4
-   version = "1.3">
4
+   version = "1.7">
5 5
    <BuildAction
6 6
       parallelizeBuildables = "YES"
7 7
       buildImplicitDependencies = "YES">
@@ -81,6 +81,10 @@
81 81
       </EnvironmentVariables>
82 82
       <AdditionalOptions>
83 83
       </AdditionalOptions>
84
+      <LocationScenarioReference
85
+         identifier = "com.apple.dt.IDEFoundation.CurrentLocationScenarioIdentifier"
86
+         referenceType = "1">
87
+      </LocationScenarioReference>
84 88
    </LaunchAction>
85 89
    <ProfileAction
86 90
       buildConfiguration = "Debug"

+ 19 - 33
PaiAi/Paiai/AppDelegate.swift

@@ -47,55 +47,41 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
47 47
             return true
48 48
     }
49 49
 
50
-    func application(_ app: UIApplication, open url: URL,
51
-                     options: [UIApplication.OpenURLOptionsKey: Any]) -> Bool {
52
-        var result: Bool = false
53
-        #if !((arch(i386) || arch(x86_64)))
54
-            switch sharedPlatform {
55
-            case 0:
56
-                result =  WXApi.handleOpen(url, delegate: self)
57
-            case 1:
58
-                result = TencentOAuth.handleOpen(url)
59
-            case 2:
60
-                result = WeiboSDK.handleOpen(url, delegate: nil)
61
-            default:
62
-                assert(false, "\((#file as NSString).lastPathComponent)[\(#line)], \(#function): share error")
63
-            }
64
-        #endif
65
-        return result
66
-    }
67 50
 
68 51
     func application(_ application: UIApplication, open url: URL,
69 52
                      sourceApplication: String?, annotation: Any) -> Bool {
70 53
         var result: Bool = false
71 54
         #if !((arch(i386) || arch(x86_64)))
72
-            switch sharedPlatform {
73
-            case 0:
74
-                result =  WXApi.handleOpen(url, delegate: self)
75
-            case 1:
76
-                result = TencentOAuth.handleOpen(url)
77
-            case 2:
78
-                result = WeiboSDK.handleOpen(url, delegate: nil)
79
-            default:
80
-                assert(false, "\((#file as NSString).lastPathComponent)[\(#line)], \(#function): share error")
81
-            }
55
+//            switch sharedPlatform {
56
+//            case 0:
57
+//                result =  WXApi.handleOpen(url, delegate: self)
58
+//            case 1:
59
+//                result = TencentOAuth.handleOpen(url)
60
+//            case 2:
61
+//                result = WeiboSDK.handleOpen(url, delegate: nil)
62
+//            default:
63
+//                assert(false, "\((#file as NSString).lastPathComponent)[\(#line)], \(#function): share error")
64
+//            }
82 65
 
83 66
         #endif
84
-        return result
67
+        return WXApi.handleOpen(url, delegate: self)
85 68
     }
86 69
 
87 70
     #if !((arch(i386) || arch(x86_64)))
88 71
     func onResp(_ resp: BaseResp!) {
89 72
         if let resp = resp as? PayResp {
90
-            var userInfo: [String: Int] = ["code": resp.errCode]
73
+            let userInfo: [String: Int] = ["code": Int(resp.errCode)]
91 74
             NotificationCenter.default.post(name: Notification.wxNotification.payDidFinish, object: nil, userInfo: userInfo)
92
-//        } else if let resp = resp as? SendAuthResp, let code = resp.code {
93
-//            NotificationCenter.default.post(name: , object: nil, userInfo: userInfo)
94
-////            wxLoginJumpFinishCallback?(["code": code as AnyObject], nil)
95
-////            wxLoginJumpFinishCallback = nil
75
+        } else if let resp = resp as? SendAuthResp {
76
+            let userInfo: [String: AnyObject] = ["errCode": Int(resp.errCode) as AnyObject, "code": resp.code as AnyObject]
77
+            NotificationCenter.default.post(name: Notification.wxNotification.login, object: nil, userInfo: userInfo)
96 78
         }
97 79
     }
98 80
     #endif
81
+    
82
+    func application(_ application: UIApplication, handleOpen url: URL) -> Bool {
83
+        return WXApi.handleOpen(url, delegate: self)
84
+    }
99 85
 }
100 86
 
101 87
 private let WIFIUploadOriginal = "WIFIUploadOriginal"

+ 4 - 4
PaiAi/Paiai/Info.plist

@@ -9,7 +9,7 @@
9 9
 	<key>CFBundleExecutable</key>
10 10
 	<string>$(EXECUTABLE_NAME)</string>
11 11
 	<key>CFBundleIdentifier</key>
12
-	<string>com.Paiai.Paiai</string>
12
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13 13
 	<key>CFBundleInfoDictionaryVersion</key>
14 14
 	<string>1.0</string>
15 15
 	<key>CFBundleName</key>
@@ -17,7 +17,7 @@
17 17
 	<key>CFBundlePackageType</key>
18 18
 	<string>APPL</string>
19 19
 	<key>CFBundleShortVersionString</key>
20
-	<string>1.1.2</string>
20
+	<string>2.0</string>
21 21
 	<key>CFBundleSignature</key>
22 22
 	<string>????</string>
23 23
 	<key>CFBundleURLTypes</key>
@@ -85,10 +85,10 @@
85 85
 	</dict>
86 86
 	<key>NSCameraUsageDescription</key>
87 87
 	<string>App需要您的同意,才能进行拍摄</string>
88
-	<key>NSPhotoLibraryUsageDescription</key>
89
-	<string>App需要您的同意,才能进行查看相册</string>
90 88
 	<key>NSPhotoLibraryAddUsageDescription</key>
91 89
 	<string>cc</string>
90
+	<key>NSPhotoLibraryUsageDescription</key>
91
+	<string>App需要您的同意,才能进行查看相册</string>
92 92
 	<key>UILaunchStoryboardName</key>
93 93
 	<string>LaunchScreen</string>
94 94
 	<key>UIRequiredDeviceCapabilities</key>

+ 0 - 2
PaiAi/PaiaiDataKit/DataLayer/Repositories/Remote/Reusable/ContentResource.swift

@@ -10,8 +10,6 @@ import Foundation
10 10
 import RxSwift
11 11
 import ObjectMapper
12 12
 
13
-struct NonMoreDataError: Error {}
14
-
15 13
 struct ContentResource<Content>: Resource {
16 14
     typealias Model = Content
17 15
     

+ 33 - 41
PaiAi/PaiaiDataKit/DataLayer/Repositories/Remote/Reusable/NetWork/NetworkApi.swift

@@ -13,43 +13,9 @@ import RxSwift
13 13
 class NetworkApi {
14 14
 
15 15
     public static let share = NetworkApi()
16
-    
17
-    private var synQueues = [OperationQueue]()
18
-
19
-    typealias FailureHandler = ((HTTPURLResponse?) -> Void)
20
-    typealias ProgressHandler = (() -> Void)
21
-    typealias FinishHandler = (() -> Void)
22 16
 
23 17
     private let sessionManager: Session
24 18
     private let session: Session
25
-
26
-    var finishHander: FinishHandler = {}
27
-
28
-    var failureHandler: FailureHandler = { response in
29
-        guard let status = response?.statusCode else {
30
-            return
31
-        }
32
-        let manager = NetworkReachabilityManager()
33
-        manager?.listener = { networkStatus in
34
-//            guard let visibleView = UIApplication.shared.keyWindow else {
35
-//                    return
36
-//            }
37
-
38
-            if networkStatus == .notReachable || networkStatus == .unknown {
39
-//                FFToastView.showToast(inView: visibleView, withText: "当前网络状态不好")
40
-                return
41
-            }
42
-
43
-            if status >= 500 {
44
-//                FFToastView.showToast(inView: visibleView, withText: "服务器出现异常")
45
-            } else if status >= 400 {
46
-                assert(true, "客户端问题")
47
-            } else if status >= 300 {
48
-                assert(true, "重定向问题")
49
-            }
50
-        }
51
-    }
52
-
53 19
     init() {
54 20
         sessionManager = Session.default
55 21
         session = Session.default
@@ -59,15 +25,37 @@ class NetworkApi {
59 25
 //        sessionManager.retrier = OAuthHandler()
60 26
     }
61 27
     
62
-    public func createSynQueue(identifier: String) {
63
-        let queue = OperationQueue()
64
-        queue.name = identifier
65
-        queue.maxConcurrentOperationCount = 1
66
-        queue.qualityOfService = .utility
67
-        queue.isSuspended = true
68
-        synQueues.append(queue)
28
+    private func handlingError(error: Error) {
29
+        guard let err = error as? AFError else {
30
+            Toast.show(message: "网络出现未知错误")
31
+            return
32
+        }
33
+        
34
+        if err.isSessionDeinitializedError
35
+            || err.isSessionInvalidatedError
36
+            || err.isInvalidURLError
37
+            || err.isRequestAdaptationError {
38
+            Toast.show(message: "客户端网络请求出错")
39
+        } else if err.isParameterEncoderError || err.isParameterEncodingError {
40
+            Toast.show(message: "客户端参数编码出错")
41
+        } else if err.isMultipartEncodingError {
42
+            Toast.show(message: "客户端上传或者下载参数编码出错")
43
+        } else if err.isResponseValidationError {
44
+            Toast.show(message: "服务器返回参数出错")
45
+        } else if err.isResponseSerializationError {
46
+            Toast.show(message: "服务器返回数据出错")
47
+        } else if err.isServerTrustEvaluationError {
48
+            Toast.show(message: "服务器验证错误")
49
+        } else if err.isRequestRetryError {
50
+            Toast.show(message: "客户端重试出错")
51
+        } else if err.isExplicitlyCancelledError {
52
+            return
53
+        } else {
54
+            Toast.show(message: "网络出现未知错误")
55
+        }
69 56
     }
70 57
     
58
+    
71 59
     public func post<A: Resource>(resource: A) -> Single<A.Model> {
72 60
         return Single<A.Model>.create(subscribe: { observer in
73 61
             let request = self.session.request(resource.host + resource.path.rawValue,
@@ -91,6 +79,7 @@ class NetworkApi {
91 79
                         }
92 80
                         
93 81
                     case .failure(let error):
82
+                        self.handlingError(error: error)
94 83
                         observer(.error(error))
95 84
                     }
96 85
             }
@@ -106,6 +95,7 @@ class NetworkApi {
106 95
                 .responseJSON { (res) in
107 96
                     switch res.result {
108 97
                     case .success(let json):
98
+                        print(json)
109 99
                         guard let json = json as? [String: AnyObject],
110 100
                             let data = resource.parse(json) else {
111 101
                                 observer(.error(ParseError()))
@@ -113,6 +103,7 @@ class NetworkApi {
113 103
                         }
114 104
                         observer(.success(data))
115 105
                     case .failure(let error):
106
+                        self.handlingError(error: error)
116 107
                         observer(.error(error))
117 108
                     }
118 109
             }
@@ -156,6 +147,7 @@ class NetworkApi {
156 147
                             observer(.error(BusinessError(id: status)))
157 148
                         }
158 149
                     case .failure(let error):
150
+                        self.handlingError(error: error)
159 151
                         observer(.error(error))
160 152
                     }
161 153
                 })

+ 72 - 111
PaiAi/PaiaiDataKit/DataLayer/Repositories/Remote/WXUserInfoRemoteAPI.swift

@@ -12,64 +12,28 @@ import RxSwift
12 12
 fileprivate let WXAppid = "wx4e22a0c8ae6d766d"
13 13
 fileprivate let WXSecret = "636ac848016c593575d11143c55c8333"
14 14
 
15
-//fileprivate protocol WXUserInfoParse: Parsable where Model == JSON {}
16
-//
17
-//extension DefaultResource: WXUserInfoParse {
18
-//    func parse(_ json: JSON) -> JSON? { return json }
19
-//}
20
-//
21
-//fileprivate struct WXResource: Resource, Parsable {
22
-//    typealias Model = UserInfo
23
-//
24
-//    var path: Interfaces { return .authorize }
25
-//    var parameter: Parameter = [:]
26
-//
27
-//    func parse(_ json: JSON) -> UserInfo? {
28
-//        guard let result = json["data"] as? JSON else { return nil }
29
-//        return UserInfo(json: result)
30
-//    }
31
-//}
32
-
33
-class WXUserInfoRemoteAPI: UserInfoRemoteAPI {
34
-    
35
-    typealias Model = UserInfo
36
-//    fileprivate var wxResource: WXResource
37
-//    fileprivate var wxTokenResource: DefaultResource
38
-//    fileprivate var wxUserInfoResource: DefaultResource
15
+struct WXUserInfoRemoteAPI: UserInfoRemoteAPI {
39 16
     
40
-    init() {
41
-        let wxUrl = "https://api.weixin.qq.com"
42
-//        self.wxResource = WXResource()
43
-//        self.wxTokenResource = DefaultResource(host: wxUrl, path: .wxAccessToken, parameter: [:])
44
-//        self.wxUserInfoResource = DefaultResource(host: wxUrl, path: .wxUserInfo, parameter: [:])
45
-    }
17
+    init() {}
46 18
     
47 19
     func login() -> Single<UserInfo> {
20
+        #if (arch(i386) || arch(x86_64))
48 21
         return Single.create(subscribe: { (observer) in
49 22
             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 23
             return Disposables.create()
51 24
         })
52
-        return Single.create(subscribe: { (observer) -> Disposable in
53
-            
54
-//            let wxLoginObserver = self.addWXLoginDidFinish()
55
-//            let wxTokenObserver = self.getWXToken()
56
-//            let wxUserInfoObserver = self.getWXUserInfo()
57
-//            let loginObserver = self.wxLogin()
58
-//            
59
-//            Single.of(wxLoginObserver,
60
-//                          wxTokenObserver,
61
-//                          wxUserInfoObserver)
62
-//                .concat().asSingle()
63
-//                .subscribe({_ in
64
-//                    loginObserver.asSingle()
65
-//                        .subscribe(onNext: { (userInfo) in
66
-//                            observer.onNext(userInfo)
67
-//                            self.removeWXLoginDidFinish()
68
-//                    }).dispose()
69
-//                }).dispose()
70
-            
71
-            return Disposables.create()
25
+        #else
26
+        loginWithWeChat()
27
+        return addWXLoginDidFinish().flatMap({
28
+            return self.getWXToken(param: $0)
29
+        }).flatMap({
30
+            return self.getWXUserInfo(param: $0)
31
+        }).flatMap({
32
+            return self.wxLogin(param: $0)
33
+        }).do(onSuccess: { res in
34
+            print(res)
72 35
         })
36
+        #endif
73 37
     }
74 38
     
75 39
     fileprivate func loginWithWeChat() {
@@ -80,68 +44,65 @@ class WXUserInfoRemoteAPI: UserInfoRemoteAPI {
80 44
         WXApi.send(request)
81 45
     }
82 46
     
83
-//    fileprivate func addWXLoginDidFinish() -> Completable {
84
-//        return Single.create { (observer) in
85
-////            NotificationCenter.default.addObserver(forName: Notification.WXLoginNotification, object: nil, queue: nil) { (notification) in
86
-////                guard let userInfo = notification.userInfo,
87
-////                    let code = userInfo["code"] as? String else { return }
88
-////                self.wxTokenResource.parameter = ["appid": WXAppid, "secret": WXSecret,
89
-////                                                  "code": code, "grant_type": "authorization_code"]
90
-////                observer.onCompleted()
91
-////            }
92
-////
93
-//            return Disposables.create()
94
-//        }
95
-//    }
96
-//
97
-//    fileprivate func getWXToken() -> Completable {
98
-//        return Single.create({ (observer) in
99
-////            let resource = ContentResource.init(host:"https://api.weixin.qq.com",
100
-////                                                path: .wxAccessToken,
101
-////                                                parameter: <#T##Parameter#>, parseJSON: <#T##(JSON) -> _?#>)
102
-////            NetworkApi.share.get(resource: self.wxTokenResource) { (result) in
103
-////                guard case let .success(data) = result,
104
-////                    let token = data["access_token"] as? String,
105
-////                    let openId = data["openid"] as? String else { return }
106
-////                self.wxUserInfoResource.parameter = ["access_token": token, "openid": openId]
107
-////                observer.onCompleted()
108
-////            }
109
-//
110
-//            return Disposables.create()
111
-//        })
112
-//    }
113
-//
114
-//    fileprivate func getWXUserInfo() -> Completable {
115
-//        return Single.create({ (observer) in
116
-////            NetworkApi.share.get(resource: self.wxUserInfoResource) { (result) in
117
-////                guard case let .success(data) = result else { return }
118
-////                if let errcode = data["errcode"] as? Int,
119
-////                    errcode == 40003 { return }
120
-////                self.wxResource.parameter = data
121
-////                observer.onCompleted()
122
-////            }
123
-//
124
-//            return Disposables.create()
125
-//        })
126
-//    }
127
-//
128
-//    fileprivate func wxLogin() -> Single<UserInfo> {
129
-//        return Single.create({ (observer) in
130
-////            NetworkApi.share.post(resource: self.wxResource) { (result) in
131
-////                guard case let .success(data) = result else { return }
132
-////                observer.onNext(data)
133
-////                observer.onCompleted()
134
-////            }
135
-////
136
-//            return Disposables.create()
137
-//        })
138
-//    }
47
+    fileprivate func addWXLoginDidFinish() -> Single<[String: String]> {
48
+        return Single.create(subscribe: { observer -> Disposable in
49
+            NotificationCenter.default.addObserver(forName: Notification.wxNotification.login, object: nil, queue: nil, using: { notification in
50
+                guard let userInfo = notification.userInfo,
51
+                    let errcode = userInfo["errCode"] as? Int,
52
+                    let code = userInfo["code"] as? String else {
53
+                        Toast.show(message: "获取code失败")
54
+                        return observer(.error(ParseError()))
55
+                }
56
+                switch errcode {
57
+                case 0:
58
+                    observer(.success(["appid": WXAppid, "secret": WXSecret,
59
+                                       "code": code, "grant_type": "authorization_code"]))
60
+                case -4:
61
+                    Toast.show(message: "您拒绝授权,登录失败")
62
+                    break
63
+                case -2:
64
+                    Toast.show(message: "您取消了登录,登录失败")
65
+                    break
66
+                default:
67
+                    Toast.show(message: "发生未知错误,登录失败")
68
+                    break
69
+                }
70
+                return observer(.error(BusinessError(id: errcode)))
71
+            })
72
+            return Disposables.create()
73
+        })
74
+    }
75
+
76
+    fileprivate func parseWxToken(json: JSON) -> [String: String]? {
77
+        guard let token = json["access_token"] as? String,
78
+            let openId = json["openid"] as? String else { return nil }
79
+        return ["access_token": token, "openid": openId]
80
+    }
81
+    
82
+    fileprivate func getWXToken(param: [String: String]) -> Single<[String: String]> {
83
+        let resource = ContentResource<[String: String]>(host: "https://api.weixin.qq.com",
84
+                                                      path: .wxAccessToken,
85
+                                                      parameter: param,
86
+                                                      parseJSON: parseWxToken)
87
+        
88
+        return NetworkApi.share.get(resource: resource)
89
+    }
90
+
91
+    fileprivate func getWXUserInfo(param: [String: String]) -> Single<[String: Any]> {
92
+        let resource = ContentResource<[String: Any]>(host: "https://api.weixin.qq.com",
93
+                                                      path: .wxUserInfo,
94
+                                                      parameter: param,
95
+                                                      parseJSON: { $0 })
96
+        return NetworkApi.share.get(resource: resource)
97
+    }
139 98
     
140
-    fileprivate func removeWXLoginDidFinish() {
141
-        NotificationCenter.default.removeObserver(self, name: Notification.WXLoginNotification, object: nil)
99
+    fileprivate func parseAuthorize(json: JSON) -> UserInfo? {
100
+        guard let data = json["data"] as? [String: AnyObject] else { return nil }
101
+        return UserInfo(json: data)
142 102
     }
143
-}
144 103
 
145
-extension Notification {
146
-    static let WXLoginNotification = Notification.Name("WXLoginDidFinishNotification")
104
+    fileprivate func wxLogin(param: [String: Any]) -> Single<UserInfo> {
105
+        let resource = ContentResource<UserInfo>(path: .authorize, parameter: param, parseJSON: parseAuthorize)
106
+        return resource.loadContent()
107
+    }
147 108
 }

+ 6 - 0
PaiAi/PaiaiDataKit/PresentLayer/UserInfoViewModel.swift

@@ -77,11 +77,17 @@ public class UserInfoViewModel {
77 77
     }
78 78
     
79 79
     public func wxLogin() {
80
+        Toast.showActivity(message: "正在登陆")
80 81
         repository.wxLogin().subscribe(onSuccess: { (userInfo) in
81 82
             self.shareUserInfo.accept(userInfo)
82 83
             self._loginCompleted.onNext(())
83 84
         }) { (error) in
85
+            print(error)
84 86
             #warning("错误处理")
85 87
         }.disposed(by: disposeBag)
86 88
     }
89
+    
90
+    deinit {
91
+        print("销毁")
92
+    }
87 93
 }

+ 1 - 0
PaiAi/PaiaiDataKit/Resuable/Extension/Notification+wxPay.swift

@@ -11,5 +11,6 @@ import Foundation
11 11
 public extension Notification {
12 12
     struct wxNotification {
13 13
         public static let payDidFinish = Notification.Name("WXPayDidFinishNotification")
14
+        public static let login = Notification.Name("WXLoginDidFinishNotification")
14 15
     }
15 16
 }

+ 0 - 1
PaiAi/Paiai_iOS/App/LoginViewController.swift

@@ -83,6 +83,5 @@ extension LoginViewController {
83 83
                     self.guestLoginBtn.isHidden = false
84 84
                 }
85 85
             }).disposed(by: disposeBag)
86
-        
87 86
     }
88 87
 }