Commit 96998f93fe4fde5877b0cc736e580c1e8fa07bc0

Authored by liushiyu
2 parents 2f2f775a fcaf1aae

Merge branch 'master' of http://bj.gitlab.cnlive.com/ios-team/CNLiveMateCode

# Conflicts:
#	metaCode.xcodeproj/project.pbxproj
@@ -12,7 +12,7 @@ target 'metaCode' do @@ -12,7 +12,7 @@ target 'metaCode' do
12 # Comment the next line if you don't want to use dynamic frameworks 12 # Comment the next line if you don't want to use dynamic frameworks
13 use_frameworks! 13 use_frameworks!
14 14
15 - pod 'YYCategories' 15 +# pod 'YYCategories'
16 16
17 # Pods for metaCode 17 # Pods for metaCode
18 #网络请求基础库 18 #网络请求基础库
metaCode.xcodeproj/project.pbxproj
@@ -62,7 +62,11 @@ @@ -62,7 +62,11 @@
62 7C4931342A307B58000E44B4 /* slide_down.gif in Resources */ = {isa = PBXBuildFile; fileRef = 7C4931332A307B58000E44B4 /* slide_down.gif */; }; 62 7C4931342A307B58000E44B4 /* slide_down.gif in Resources */ = {isa = PBXBuildFile; fileRef = 7C4931332A307B58000E44B4 /* slide_down.gif */; };
63 7C4931362A307B60000E44B4 /* slide_up.gif in Resources */ = {isa = PBXBuildFile; fileRef = 7C4931352A307B60000E44B4 /* slide_up.gif */; }; 63 7C4931362A307B60000E44B4 /* slide_up.gif in Resources */ = {isa = PBXBuildFile; fileRef = 7C4931352A307B60000E44B4 /* slide_up.gif */; };
64 7C4931382A307BDB000E44B4 /* CNHomePageGuideView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C4931372A307BDB000E44B4 /* CNHomePageGuideView.swift */; }; 64 7C4931382A307BDB000E44B4 /* CNHomePageGuideView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C4931372A307BDB000E44B4 /* CNHomePageGuideView.swift */; };
65 - 7C7C62F62A4D72E9007A912E /* CNMetaCodeDB.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C7C62F52A4D72E9007A912E /* CNMetaCodeDB.swift */; }; 65 + 7C7C62F62A4D72E9007A912E /* CNIdentityDB.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C7C62F52A4D72E9007A912E /* CNIdentityDB.swift */; };
  66 + 7C83B43E2A52B8BA004BF4A4 /* CNHomePageViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C83B43D2A52B8BA004BF4A4 /* CNHomePageViewModel.swift */; };
  67 + 7C83B4402A52BB2B004BF4A4 /* CNGlobalEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C83B43F2A52BB2B004BF4A4 /* CNGlobalEnum.swift */; };
  68 + 7C83B4422A541EBF004BF4A4 /* CALayer+CNLiveExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C83B4412A541EBF004BF4A4 /* CALayer+CNLiveExtensions.swift */; };
  69 + 7C83B4442A541F36004BF4A4 /* NSDate+CNLiveExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C83B4432A541F36004BF4A4 /* NSDate+CNLiveExtensions.swift */; };
66 7CD675292A270F6A008354C1 /* WJColorChange.m in Sources */ = {isa = PBXBuildFile; fileRef = 7CD675282A270F6A008354C1 /* WJColorChange.m */; }; 70 7CD675292A270F6A008354C1 /* WJColorChange.m in Sources */ = {isa = PBXBuildFile; fileRef = 7CD675282A270F6A008354C1 /* WJColorChange.m */; };
67 7CD6753C2A2740B0008354C1 /* CNUpSlideViewRemindView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CD675372A2740B0008354C1 /* CNUpSlideViewRemindView.swift */; }; 71 7CD6753C2A2740B0008354C1 /* CNUpSlideViewRemindView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CD675372A2740B0008354C1 /* CNUpSlideViewRemindView.swift */; };
68 7CD6753D2A2740B0008354C1 /* CNMainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CD675382A2740B0008354C1 /* CNMainView.swift */; }; 72 7CD6753D2A2740B0008354C1 /* CNMainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CD675382A2740B0008354C1 /* CNMainView.swift */; };
@@ -159,7 +163,11 @@ @@ -159,7 +163,11 @@
159 7C4931332A307B58000E44B4 /* slide_down.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = slide_down.gif; sourceTree = "<group>"; }; 163 7C4931332A307B58000E44B4 /* slide_down.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = slide_down.gif; sourceTree = "<group>"; };
160 7C4931352A307B60000E44B4 /* slide_up.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = slide_up.gif; sourceTree = "<group>"; }; 164 7C4931352A307B60000E44B4 /* slide_up.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = slide_up.gif; sourceTree = "<group>"; };
161 7C4931372A307BDB000E44B4 /* CNHomePageGuideView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNHomePageGuideView.swift; sourceTree = "<group>"; }; 165 7C4931372A307BDB000E44B4 /* CNHomePageGuideView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNHomePageGuideView.swift; sourceTree = "<group>"; };
162 - 7C7C62F52A4D72E9007A912E /* CNMetaCodeDB.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNMetaCodeDB.swift; sourceTree = "<group>"; }; 166 + 7C7C62F52A4D72E9007A912E /* CNIdentityDB.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNIdentityDB.swift; sourceTree = "<group>"; };
  167 + 7C83B43D2A52B8BA004BF4A4 /* CNHomePageViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNHomePageViewModel.swift; sourceTree = "<group>"; };
  168 + 7C83B43F2A52BB2B004BF4A4 /* CNGlobalEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNGlobalEnum.swift; sourceTree = "<group>"; };
  169 + 7C83B4412A541EBF004BF4A4 /* CALayer+CNLiveExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CALayer+CNLiveExtensions.swift"; sourceTree = "<group>"; };
  170 + 7C83B4432A541F36004BF4A4 /* NSDate+CNLiveExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSDate+CNLiveExtensions.swift"; sourceTree = "<group>"; };
163 7CD675262A270F69008354C1 /* metaCode-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "metaCode-Bridging-Header.h"; sourceTree = "<group>"; }; 171 7CD675262A270F69008354C1 /* metaCode-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "metaCode-Bridging-Header.h"; sourceTree = "<group>"; };
164 7CD675272A270F6A008354C1 /* WJColorChange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WJColorChange.h; sourceTree = "<group>"; }; 172 7CD675272A270F6A008354C1 /* WJColorChange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WJColorChange.h; sourceTree = "<group>"; };
165 7CD675282A270F6A008354C1 /* WJColorChange.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WJColorChange.m; sourceTree = "<group>"; }; 173 7CD675282A270F6A008354C1 /* WJColorChange.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WJColorChange.m; sourceTree = "<group>"; };
@@ -236,10 +244,12 @@ @@ -236,10 +244,12 @@
236 790D01842A2D89E100C5978D /* UIColor+CNLiveExtensions.swift */, 244 790D01842A2D89E100C5978D /* UIColor+CNLiveExtensions.swift */,
237 7C49312C2A2DB9FA000E44B4 /* UITabBar+CNLiveExtensions.swift */, 245 7C49312C2A2DB9FA000E44B4 /* UITabBar+CNLiveExtensions.swift */,
238 790D019C2A2DCBD000C5978D /* UIView+CNLiveExtensions.swift */, 246 790D019C2A2DCBD000C5978D /* UIView+CNLiveExtensions.swift */,
  247 + 7C83B4412A541EBF004BF4A4 /* CALayer+CNLiveExtensions.swift */,
239 79282A3B2A2EDC2500B5F8CF /* NSString+CNLiveExtensions.swift */, 248 79282A3B2A2EDC2500B5F8CF /* NSString+CNLiveExtensions.swift */,
240 798A44EF2A305BC200815935 /* UIButton+CNLiveExtensions.swift */, 249 798A44EF2A305BC200815935 /* UIButton+CNLiveExtensions.swift */,
241 79396EEC2A319F220053E1AF /* NSObject+CNLiveExtensions.swift */, 250 79396EEC2A319F220053E1AF /* NSObject+CNLiveExtensions.swift */,
242 790B1FB52A41938F0074CF00 /* UIImage+CNLiveExtensions.swift */, 251 790B1FB52A41938F0074CF00 /* UIImage+CNLiveExtensions.swift */,
  252 + 7C83B4432A541F36004BF4A4 /* NSDate+CNLiveExtensions.swift */,
243 ); 253 );
244 path = Extensions; 254 path = Extensions;
245 sourceTree = "<group>"; 255 sourceTree = "<group>";
@@ -329,9 +339,8 @@ @@ -329,9 +339,8 @@
329 7963988A2A260B3300D045EB /* Classes */ = { 339 7963988A2A260B3300D045EB /* Classes */ = {
330 isa = PBXGroup; 340 isa = PBXGroup;
331 children = ( 341 children = (
332 - 7C7C62F42A4D72BA007A912E /* DB */,  
333 7C2703342A3AFD130061EC50 /* Environment */, 342 7C2703342A3AFD130061EC50 /* Environment */,
334 - 7C2703312A36CC430061EC50 /* GlobalBlock */, 343 + 7C2703312A36CC430061EC50 /* Global */,
335 798A44F32A3077ED00815935 /* CustomView */, 344 798A44F32A3077ED00815935 /* CustomView */,
336 790D01832A2D89E100C5978D /* Extensions */, 345 790D01832A2D89E100C5978D /* Extensions */,
337 796398912A260C0100D045EB /* Common */, 346 796398912A260C0100D045EB /* Common */,
@@ -457,12 +466,13 @@ @@ -457,12 +466,13 @@
457 path = CustomView; 466 path = CustomView;
458 sourceTree = "<group>"; 467 sourceTree = "<group>";
459 }; 468 };
460 - 7C2703312A36CC430061EC50 /* GlobalBlock */ = { 469 + 7C2703312A36CC430061EC50 /* Global */ = {
461 isa = PBXGroup; 470 isa = PBXGroup;
462 children = ( 471 children = (
463 7C2703322A36CC660061EC50 /* CNLiveGlobalBlock.swift */, 472 7C2703322A36CC660061EC50 /* CNLiveGlobalBlock.swift */,
  473 + 7C83B43F2A52BB2B004BF4A4 /* CNGlobalEnum.swift */,
464 ); 474 );
465 - path = GlobalBlock; 475 + path = Global;
466 sourceTree = "<group>"; 476 sourceTree = "<group>";
467 }; 477 };
468 7C2703342A3AFD130061EC50 /* Environment */ = { 478 7C2703342A3AFD130061EC50 /* Environment */ = {
@@ -476,14 +486,25 @@ @@ -476,14 +486,25 @@
476 7C7C62F42A4D72BA007A912E /* DB */ = { 486 7C7C62F42A4D72BA007A912E /* DB */ = {
477 isa = PBXGroup; 487 isa = PBXGroup;
478 children = ( 488 children = (
479 - 7C7C62F52A4D72E9007A912E /* CNMetaCodeDB.swift */, 489 + 7C7C62F52A4D72E9007A912E /* CNIdentityDB.swift */,
480 ); 490 );
481 path = DB; 491 path = DB;
482 sourceTree = "<group>"; 492 sourceTree = "<group>";
483 }; 493 };
  494 + 7C83B43C2A52B899004BF4A4 /* ViewModel */ = {
  495 + isa = PBXGroup;
  496 + children = (
  497 + 7C83B43D2A52B8BA004BF4A4 /* CNHomePageViewModel.swift */,
  498 + );
  499 + name = ViewModel;
  500 + path = HomePage/ViewModel;
  501 + sourceTree = "<group>";
  502 + };
484 7CD675212A26F844008354C1 /* HomePage */ = { 503 7CD675212A26F844008354C1 /* HomePage */ = {
485 isa = PBXGroup; 504 isa = PBXGroup;
486 children = ( 505 children = (
  506 + 7C7C62F42A4D72BA007A912E /* DB */,
  507 + 7C83B43C2A52B899004BF4A4 /* ViewModel */,
487 7CD6754D2A2840B9008354C1 /* Controller */, 508 7CD6754D2A2840B9008354C1 /* Controller */,
488 7CD675232A26F8F8008354C1 /* View */, 509 7CD675232A26F8F8008354C1 /* View */,
489 ); 510 );
@@ -830,18 +851,25 @@ @@ -830,18 +851,25 @@
830 790B1FB82A41B6A60074CF00 /* CNLiveMineMessageViewController.swift in Sources */, 851 790B1FB82A41B6A60074CF00 /* CNLiveMineMessageViewController.swift in Sources */,
831 798A44F22A30674200815935 /* CNLiveMineSubBodyListView.swift in Sources */, 852 798A44F22A30674200815935 /* CNLiveMineSubBodyListView.swift in Sources */,
832 790D01822A2D88FC00C5978D /* CNLiveConfigMacro.swift in Sources */, 853 790D01822A2D88FC00C5978D /* CNLiveConfigMacro.swift in Sources */,
  854 + 7C83B4402A52BB2B004BF4A4 /* CNGlobalEnum.swift in Sources */,
  855 + 7C83B4442A541F36004BF4A4 /* NSDate+CNLiveExtensions.swift in Sources */,
833 7CD675482A274167008354C1 /* PGIndexBannerSubiew.m in Sources */, 856 7CD675482A274167008354C1 /* PGIndexBannerSubiew.m in Sources */,
834 790D019F2A2DD66E00C5978D /* CNLiveLoginViewModel.swift in Sources */, 857 790D019F2A2DD66E00C5978D /* CNLiveLoginViewModel.swift in Sources */,
  858 + 7C7C62F62A4D72E9007A912E /* CNIdentityDB.swift in Sources */,
  859 + 790B1FB62A41938F0074CF00 /* UIImage+CNLiveExtensions.swift in Sources */,
  860 + 790D019D2A2DCBD000C5978D /* UIView+CNLiveExtensions.swift in Sources */,
835 790B1FB62A41938F0074CF00 /* UIImage+CNLiveExtensions.swift in Sources */, 861 790B1FB62A41938F0074CF00 /* UIImage+CNLiveExtensions.swift in Sources */,
836 790D019D2A2DCBD000C5978D /* UIView+CNLiveExtensions.swift in Sources */, 862 790D019D2A2DCBD000C5978D /* UIView+CNLiveExtensions.swift in Sources */,
837 7C7C62F62A4D72E9007A912E /* CNMetaCodeDB.swift in Sources */, 863 7C7C62F62A4D72E9007A912E /* CNMetaCodeDB.swift in Sources */,
838 790B1FB62A41938F0074CF00 /* UIImage+CNLiveExtensions.swift in Sources */, 864 790B1FB62A41938F0074CF00 /* UIImage+CNLiveExtensions.swift in Sources */,
839 790D019D2A2DCBD000C5978D /* UIView+CNLiveExtensions.swift in Sources */, 865 790D019D2A2DCBD000C5978D /* UIView+CNLiveExtensions.swift in Sources */,
  866 + 7C83B4422A541EBF004BF4A4 /* CALayer+CNLiveExtensions.swift in Sources */,
840 798A44F72A3077ED00815935 /* CNLiveHotButton.swift in Sources */, 867 798A44F72A3077ED00815935 /* CNLiveHotButton.swift in Sources */,
841 7CD6753D2A2740B0008354C1 /* CNMainView.swift in Sources */, 868 7CD6753D2A2740B0008354C1 /* CNMainView.swift in Sources */,
842 793CAF522A58FCA200882EF4 /* CNLiveMineExchangeViewController.swift in Sources */, 869 793CAF522A58FCA200882EF4 /* CNLiveMineExchangeViewController.swift in Sources */,
843 7CD675522A29C04B008354C1 /* CNLiveConfigstant.swift in Sources */, 870 7CD675522A29C04B008354C1 /* CNLiveConfigstant.swift in Sources */,
844 79282A402A2F055100B5F8CF /* CNLiveConfigUserInfo.swift in Sources */, 871 79282A402A2F055100B5F8CF /* CNLiveConfigUserInfo.swift in Sources */,
  872 + 7C83B43E2A52B8BA004BF4A4 /* CNHomePageViewModel.swift in Sources */,
845 7C4931382A307BDB000E44B4 /* CNHomePageGuideView.swift in Sources */, 873 7C4931382A307BDB000E44B4 /* CNHomePageGuideView.swift in Sources */,
846 7CD6753E2A2740B0008354C1 /* CNUpSlideView.swift in Sources */, 874 7CD6753E2A2740B0008354C1 /* CNUpSlideView.swift in Sources */,
847 7CD675402A2740B0008354C1 /* CNDownSlideView.swift in Sources */, 875 7CD675402A2740B0008354C1 /* CNDownSlideView.swift in Sources */,
metaCode/Classes/Common/Util/CNLiveCommonQiniuTool.swift
@@ -7,7 +7,6 @@ @@ -7,7 +7,6 @@
7 7
8 import Foundation 8 import Foundation
9 import Qiniu 9 import Qiniu
10 -import YYCategories  
11 import CNLiveRequestBastKit 10 import CNLiveRequestBastKit
12 11
13 typealias ProgressBlcok = (_ key: String,_ percent: CGFloat) -> Void 12 typealias ProgressBlcok = (_ key: String,_ percent: CGFloat) -> Void
metaCode/Classes/DB/CNMetaCodeDB.swift deleted 100644 → 0
1 -//  
2 -// CNMetaCodeDB.swift  
3 -// metaCode  
4 -// 数据库  
5 -// Created by daojian on 2023/6/29.  
6 -//  
7 -  
8 -import Foundation  
9 -  
metaCode/Classes/Environment/CNLiveEnvironment.swift
@@ -11,8 +11,8 @@ import Foundation @@ -11,8 +11,8 @@ import Foundation
11 let APPId: String = CNLiveEnvironmentManager.shared.appId 11 let APPId: String = CNLiveEnvironmentManager.shared.appId
12 ///当前应用的APPKey 12 ///当前应用的APPKey
13 let APPKey: String = CNLiveEnvironmentManager.shared.appKey 13 let APPKey: String = CNLiveEnvironmentManager.shared.appKey
14 -///当前应用的网络请求域名  
15 -let APPBaseUrl: String! = CNLiveEnvironmentManager.shared.baseUrl 14 +///当前应用的登录请求域名
  15 +let APPLoginHost: String! = CNLiveEnvironmentManager.shared.loginHost
16 ///当前应用的Secret 16 ///当前应用的Secret
17 let APPSecret: String = CNLiveEnvironmentManager.shared.appSecret 17 let APPSecret: String = CNLiveEnvironmentManager.shared.appSecret
18 ///当前应用的部分请求接口 18 ///当前应用的部分请求接口
@@ -46,12 +46,14 @@ class CNLiveEnvironmentManager: NSObject{ @@ -46,12 +46,14 @@ class CNLiveEnvironmentManager: NSObject{
46 46
47 var appId: String 47 var appId: String
48 var appKey: String 48 var appKey: String
49 - var baseUrl: String  
50 var appSecret: String 49 var appSecret: String
  50 + ///登录接口域名
  51 + var loginHost: String
  52 + /// 码云项目的主域名
51 var base_mc_url: String 53 var base_mc_url: String
  54 + /// 获取IM token 请求域名
52 var img_token_url: String 55 var img_token_url: String
53 56
54 -  
55 ///当前环境 57 ///当前环境
56 var currentEnvironment: CNLiveEnvironment 58 var currentEnvironment: CNLiveEnvironment
57 59
@@ -59,7 +61,7 @@ class CNLiveEnvironmentManager: NSObject{ @@ -59,7 +61,7 @@ class CNLiveEnvironmentManager: NSObject{
59 private override init() { 61 private override init() {
60 self.appId = "" 62 self.appId = ""
61 self.appKey = "" 63 self.appKey = ""
62 - self.baseUrl = "" 64 + self.loginHost = ""
63 self.appSecret = "" 65 self.appSecret = ""
64 self.base_mc_url = "" 66 self.base_mc_url = ""
65 self.img_token_url = "" 67 self.img_token_url = ""
@@ -94,7 +96,7 @@ class CNLiveEnvironmentManager: NSObject{ @@ -94,7 +96,7 @@ class CNLiveEnvironmentManager: NSObject{
94 self.appId = "802_li40qhp922" 96 self.appId = "802_li40qhp922"
95 self.appKey = "ae3a7ad3e4b9beb7cfe2078db648ebb89aa249ca2e82ac" 97 self.appKey = "ae3a7ad3e4b9beb7cfe2078db648ebb89aa249ca2e82ac"
96 self.appSecret = "3cc9f12db322a3d3656012ef929604cf6d6847471535f9" 98 self.appSecret = "3cc9f12db322a3d3656012ef929604cf6d6847471535f9"
97 - self.baseUrl = "https://api.cnlive.com" 99 + self.loginHost = "https://api.cnlive.com"
98 self.img_token_url = "https://api.cnlive.com/open/api2" 100 self.img_token_url = "https://api.cnlive.com/open/api2"
99 self.base_mc_url = "https://metacode.cnlive.com/api" 101 self.base_mc_url = "https://metacode.cnlive.com/api"
100 } 102 }
@@ -103,7 +105,7 @@ class CNLiveEnvironmentManager: NSObject{ @@ -103,7 +105,7 @@ class CNLiveEnvironmentManager: NSObject{
103 self.appId = "802_li40qhp922" 105 self.appId = "802_li40qhp922"
104 self.appKey = "ae3a7ad3e4b9beb7cfe2078db648ebb89aa249ca2e82ac" 106 self.appKey = "ae3a7ad3e4b9beb7cfe2078db648ebb89aa249ca2e82ac"
105 self.appSecret = "3cc9f12db322a3d3656012ef929604cf6d6847471535f9" 107 self.appSecret = "3cc9f12db322a3d3656012ef929604cf6d6847471535f9"
106 - self.baseUrl = "https://api.cnlive.com" 108 + self.loginHost = "https://api.cnlive.com"
107 self.img_token_url = "https://api.cnlive.com/open/api2" 109 self.img_token_url = "https://api.cnlive.com/open/api2"
108 self.base_mc_url = "https://metacode.cnlive.com/api" 110 self.base_mc_url = "https://metacode.cnlive.com/api"
109 } 111 }
@@ -112,7 +114,7 @@ class CNLiveEnvironmentManager: NSObject{ @@ -112,7 +114,7 @@ class CNLiveEnvironmentManager: NSObject{
112 self.appId = "769_li40lrkt53" 114 self.appId = "769_li40lrkt53"
113 self.appKey = "064f392f84dfe7bbe9f1eabeda53ea02044213019b0406" 115 self.appKey = "064f392f84dfe7bbe9f1eabeda53ea02044213019b0406"
114 self.appSecret = "68b5cc42fbdb466d56c2e22b00b1494feec8149f9dd32e" 116 self.appSecret = "68b5cc42fbdb466d56c2e22b00b1494feec8149f9dd32e"
115 - self.baseUrl = "https://api.cnlive.com" 117 + self.loginHost = "https://api.cnlive.com"
116 self.img_token_url = "https://api.cnlive.com/open/api2" 118 self.img_token_url = "https://api.cnlive.com/open/api2"
117 self.base_mc_url = "https://metacode.cnlive.com/api" 119 self.base_mc_url = "https://metacode.cnlive.com/api"
118 } 120 }
metaCode/Classes/Extensions/CALayer+CNLiveExtensions.swift 0 → 100644
  1 +//
  2 +// CALayer+CNLiveExtensions.swift
  3 +// metaCode
  4 +//
  5 +// Created by daojian on 2023/7/4.
  6 +//
  7 +
  8 +import Foundation
  9 +
  10 +extension CALayer{
  11 +
  12 + public var left:CGFloat{
  13 +
  14 + set{
  15 +
  16 + var frame = self.frame
  17 +
  18 + frame.origin.x = newValue
  19 +
  20 + self.frame = frame
  21 +
  22 + }
  23 +
  24 + get{
  25 +
  26 + return self.frame.origin.x
  27 +
  28 + }
  29 +
  30 + }
  31 +
  32 + public var top:CGFloat{
  33 +
  34 + set{
  35 +
  36 + var frame = self.frame
  37 +
  38 + frame.origin.y = newValue
  39 +
  40 + self.frame = frame
  41 +
  42 + }
  43 +
  44 + get{
  45 +
  46 + return self.frame.origin.y
  47 +
  48 + }
  49 +
  50 + }
  51 +
  52 + public var right:CGFloat{
  53 +
  54 + set{
  55 +
  56 + var frame = self.frame
  57 +
  58 + frame.origin.x = newValue - frame.size.width
  59 +
  60 + self.frame = frame
  61 +
  62 + }
  63 +
  64 + get{
  65 +
  66 + return self.frame.origin.x + self.frame.size.width
  67 +
  68 + }
  69 +
  70 + }
  71 +
  72 + public var bottom:CGFloat{
  73 +
  74 + set{
  75 +
  76 + var frame = self.frame
  77 +
  78 + frame.origin.y = newValue - frame.size.height
  79 +
  80 + self.frame = frame
  81 +
  82 + }
  83 +
  84 + get{
  85 +
  86 + return self.frame.origin.y + self.frame.size.height
  87 +
  88 + }
  89 +
  90 + }
  91 + public var center:CGPoint{
  92 + set{
  93 + var frame = self.frame;
  94 + frame.origin.x = newValue.x - frame.size.width * 0.5;
  95 + frame.origin.y = newValue.y - frame.size.height * 0.5;
  96 + self.frame = frame;
  97 + }
  98 +
  99 + get{
  100 +
  101 + return CGPointMake(self.frame.origin.x + self.frame.size.width * 0.5,
  102 + self.frame.origin.y + self.frame.size.height * 0.5);
  103 + }
  104 + }
  105 + public var centerX:CGFloat{
  106 +
  107 + set{
  108 +
  109 + var frame = self.frame;
  110 + frame.origin.x = newValue - frame.size.width * 0.5;
  111 + self.frame = frame;
  112 +
  113 + }
  114 +
  115 + get{
  116 +
  117 + return self.frame.origin.x + self.frame.size.width * 0.5;
  118 +
  119 + }
  120 +
  121 + }
  122 +
  123 + public var centerY:CGFloat{
  124 +
  125 + set{
  126 +
  127 + var frame = self.frame;
  128 + frame.origin.y = newValue - frame.size.height * 0.5;
  129 + self.frame = frame;
  130 + }
  131 +
  132 + get{
  133 +
  134 + return self.frame.origin.y + self.frame.size.height * 0.5;
  135 +
  136 + }
  137 +
  138 + }
  139 +
  140 + public var width:CGFloat{
  141 +
  142 + set{
  143 +
  144 + var frame = self.frame
  145 +
  146 + frame.size.width = newValue
  147 +
  148 + self.frame = frame
  149 +
  150 + }
  151 +
  152 + get{
  153 +
  154 + return self.frame.size.width
  155 +
  156 + }
  157 +
  158 + }
  159 +
  160 + public var height:CGFloat{
  161 +
  162 + set{
  163 +
  164 + var frame = self.frame
  165 +
  166 + frame.size.height = newValue
  167 +
  168 + self.frame = frame
  169 +
  170 + }
  171 +
  172 + get{
  173 +
  174 + return self.frame.size.height
  175 +
  176 + }
  177 +
  178 + }
  179 +
  180 +
  181 + public var origin:CGPoint{
  182 + set{
  183 + var frame = self.frame
  184 + frame.origin = newValue
  185 + self.frame = frame
  186 + }
  187 +
  188 + get{
  189 + return self.frame.origin
  190 + }
  191 + }
  192 +
  193 + public var size:CGSize {
  194 + set{
  195 + var frame = self.frame;
  196 + frame.size = newValue;
  197 + self.frame = frame;
  198 + }
  199 +
  200 + get{
  201 + return self.frame.size
  202 + }
  203 + }
  204 +}
metaCode/Classes/Extensions/NSDate+CNLiveExtensions.swift 0 → 100644
  1 +//
  2 +// NSDate+CNLiveExtensions.swift
  3 +// metaCode
  4 +//
  5 +// Created by daojian on 2023/7/4.
  6 +//
  7 +
  8 +import Foundation
  9 +
  10 +extension NSDate{
  11 +
  12 + func string(withFormat format:String)->String{
  13 + let formatter: DateFormatter = DateFormatter()
  14 + formatter.dateFormat = format
  15 + formatter.locale = Locale.current
  16 + return formatter.string(from: self as Date)
  17 + }
  18 +
  19 +}
metaCode/Classes/Extensions/NSString+CNLiveExtensions.swift
@@ -18,4 +18,21 @@ extension NSString { @@ -18,4 +18,21 @@ extension NSString {
18 var val:Int = 0 18 var val:Int = 0
19 return scan.scanInt(&val) && scan.isAtEnd 19 return scan.scanInt(&val) && scan.isAtEnd
20 } 20 }
  21 +
  22 +
  23 + /// 当前字符串是否为空
  24 + /// - Returns: YES:不为空, NO为空
  25 + func isNotBlank()->Bool {
  26 +
  27 + let blank:NSCharacterSet = NSCharacterSet.whitespacesAndNewlines as NSCharacterSet
  28 +
  29 + let count = self.length
  30 + for i in (0..<count) {
  31 + let c: unichar = self.character(at: i)
  32 + if(!blank.characterIsMember(c)){
  33 + return true
  34 + }
  35 + }
  36 + return false;
  37 + }
21 } 38 }
metaCode/Classes/Extensions/UIView+CNLiveExtensions.swift
@@ -57,4 +57,182 @@ extension UIView { @@ -57,4 +57,182 @@ extension UIView {
57 maskLayer.path = maskPath.cgPath 57 maskLayer.path = maskPath.cgPath
58 self.layer.mask = maskLayer 58 self.layer.mask = maskLayer
59 } 59 }
  60 +
  61 +
  62 + public var left:CGFloat{
  63 +
  64 + set{
  65 +
  66 + var frame = self.frame
  67 +
  68 + frame.origin.x = newValue
  69 +
  70 + self.frame = frame
  71 +
  72 + }
  73 +
  74 + get{
  75 +
  76 + return self.frame.origin.x
  77 +
  78 + }
  79 +
  80 + }
  81 +
  82 + public var top:CGFloat{
  83 +
  84 + set{
  85 +
  86 + var frame = self.frame
  87 +
  88 + frame.origin.y = newValue
  89 +
  90 + self.frame = frame
  91 +
  92 + }
  93 +
  94 + get{
  95 +
  96 + return self.frame.origin.y
  97 +
  98 + }
  99 +
  100 + }
  101 +
  102 + public var right:CGFloat{
  103 +
  104 + set{
  105 +
  106 + var frame = self.frame
  107 +
  108 + frame.origin.x = newValue - frame.size.width
  109 +
  110 + self.frame = frame
  111 +
  112 + }
  113 +
  114 + get{
  115 +
  116 + return self.frame.origin.x + self.frame.size.width
  117 +
  118 + }
  119 +
  120 + }
  121 +
  122 + public var bottom:CGFloat{
  123 +
  124 + set{
  125 +
  126 + var frame = self.frame
  127 +
  128 + frame.origin.y = newValue - frame.size.height
  129 +
  130 + self.frame = frame
  131 +
  132 + }
  133 +
  134 + get{
  135 +
  136 + return self.frame.origin.y + self.frame.size.height
  137 +
  138 + }
  139 +
  140 + }
  141 +
  142 + public var centerX:CGFloat{
  143 +
  144 + set{
  145 +
  146 + self.center = CGPoint(x:newValue, y:self.center.x)
  147 +
  148 + }
  149 +
  150 + get{
  151 +
  152 + return self.center.x
  153 +
  154 + }
  155 +
  156 + }
  157 +
  158 + public var centerY:CGFloat{
  159 +
  160 + set{
  161 +
  162 + self.center = CGPoint(x:self.center.x, y:newValue)
  163 +
  164 + }
  165 +
  166 + get{
  167 +
  168 + return self.center.y
  169 +
  170 + }
  171 +
  172 + }
  173 +
  174 + public var width:CGFloat{
  175 +
  176 + set{
  177 +
  178 + var frame = self.frame
  179 +
  180 + frame.size.width = newValue
  181 +
  182 + self.frame = frame
  183 +
  184 + }
  185 +
  186 + get{
  187 +
  188 + return self.frame.size.width
  189 +
  190 + }
  191 +
  192 + }
  193 +
  194 + public var height:CGFloat{
  195 +
  196 + set{
  197 +
  198 + var frame = self.frame
  199 +
  200 + frame.size.height = newValue
  201 +
  202 + self.frame = frame
  203 +
  204 + }
  205 +
  206 + get{
  207 +
  208 + return self.frame.size.height
  209 +
  210 + }
  211 +
  212 + }
  213 +
  214 +
  215 + public var origin:CGPoint{
  216 + set{
  217 + var frame = self.frame
  218 + frame.origin = newValue
  219 + self.frame = frame
  220 + }
  221 +
  222 + get{
  223 + return self.frame.origin
  224 + }
  225 + }
  226 +
  227 + public var size:CGSize {
  228 + set{
  229 + var frame = self.frame;
  230 + frame.size = newValue;
  231 + self.frame = frame;
  232 + }
  233 +
  234 + get{
  235 + return self.frame.size
  236 + }
  237 + }
60 } 238 }
metaCode/Classes/Global/CNGlobalEnum.swift 0 → 100644
  1 +//
  2 +// CNGlobalEnum.swift
  3 +// metaCode
  4 +//
  5 +// Created by daojian on 2023/7/3.
  6 +//
  7 +
  8 +import Foundation
  9 +///网络请求响应状态
  10 +enum CNNetworkingResponseType {
  11 + ///成功
  12 + case success
  13 + ///失败
  14 + case failed
  15 + ///无网
  16 + case noNetwork
  17 +}
metaCode/Classes/GlobalBlock/CNLiveGlobalBlock.swift renamed to metaCode/Classes/Global/CNLiveGlobalBlock.swift
metaCode/Classes/Main/DB/CNIdentityDB.swift 0 → 100644
  1 +//
  2 +// CNMetaCodeDB.swift
  3 +// metaCode
  4 +// 数据库
  5 +// Created by daojian on 2023/6/29.
  6 +//
  7 +
  8 +import Foundation
  9 +import WCDBSwift
  10 +
  11 +///身份认证表名
  12 +let CNIdentityTableName = "CNIdentityTable"
  13 +
  14 +///身份model
  15 +class CNIdentityModel: BaseModel,TableCodable {
  16 + var id: String = ""
  17 + var name: String?
  18 + var icon: String?
  19 + var createTime: String?
  20 + var enable: Bool?
  21 +
  22 + enum CodingKeys: String, CodingTableKey {
  23 + typealias Root = CNIdentityModel
  24 + static let objectRelationalMapping = TableBinding(CodingKeys.self){
  25 + //设置表的主键key为id,用来区分数据唯一性, 如果id为int类型,可以按实现按顺序递增
  26 + BindColumnConstraint(id, isPrimary: true)
  27 + }
  28 + case id //不修改数据库字段名,和属性名保持一直
  29 + case name //不修改数据库字段名,和属性名保持一直
  30 + case icon
  31 + case createTime
  32 + case enable
  33 + }
  34 +
  35 +}
  36 +
  37 +///身份列表数据库
  38 +class CNIdentityDB :NSObject{
  39 +
  40 + ///数据库
  41 + var database:Database
  42 +
  43 + //重新init方法为私有,不让外部调用
  44 + override init() {
  45 +
  46 + //数据库地址
  47 + let filePath = NSHomeDirectory() + "/Documents/DB/CNIdentity.db"
  48 + database = Database(at: filePath)
  49 +
  50 + super.init()
  51 + self.createTable(name: CNIdentityTableName, classType: CNIdentityModel.self)
  52 + }
  53 +
  54 + /// 创建表
  55 + /// - Parameters:
  56 + /// - name: 表名
  57 + /// - classType: class类型,当前class需要实现 TableCodable
  58 + private func createTable<Root:TableDecodable>(name:String, classType: Root.Type){
  59 + do{
  60 + try database.create(table: name, of: classType)
  61 + }
  62 + catch{
  63 + print("创建失败")
  64 + }
  65 +
  66 + }
  67 +
  68 + /// 新增一条数据
  69 + /// - Parameter object: 数据
  70 + func insterObject(object: CNIdentityModel){
  71 + let array: [CNIdentityModel] = [object]
  72 + self.insterObjects(objects: array)
  73 + }
  74 +
  75 + ///新增多条数据
  76 + func insterObjects(objects: Array<CNIdentityModel>){
  77 + do{
  78 + try database.insert(objects, intoTable: CNIdentityTableName)
  79 + }
  80 + catch{
  81 + print("增加一条数据失败")
  82 + }
  83 + }
  84 +
  85 + /// 删除一条数据
  86 + /// - Parameter delete: 被删除的数据
  87 + func deleteObject(delete: CNIdentityModel){
  88 +
  89 + do{
  90 + try database.delete(fromTable: CNIdentityTableName, where: CNIdentityModel.Properties.id == delete.id)
  91 + }
  92 + catch{
  93 + print("删除一条数据失败")
  94 + }
  95 + }
  96 +
  97 + ///更新一条数据
  98 + func updateObject(newObject:CNIdentityModel){
  99 + do{
  100 + //需要更新的字段
  101 + let updateProperties = [CNIdentityModel.Properties.name,
  102 + CNIdentityModel.Properties.icon,
  103 + CNIdentityModel.Properties.createTime,
  104 + CNIdentityModel.Properties.enable]
  105 +
  106 + try database.update(table: CNIdentityTableName, on:updateProperties, with: newObject,where: CNIdentityModel.Properties.id == newObject.id)
  107 + }
  108 + catch{
  109 + print("更新一条数据失败")
  110 + }
  111 + }
  112 +
  113 + ///获取所有数据
  114 + func searchAllObject()-> Array<CNIdentityModel>{
  115 + do{
  116 + let allData: [CNIdentityModel] = try database.getObjects(fromTable: CNIdentityTableName)
  117 + return allData
  118 + }
  119 + catch{
  120 + print("获取失败")
  121 + return []
  122 + }
  123 +
  124 +
  125 + }
  126 +
  127 +}
  128 +
  129 +
  130 +
metaCode/Classes/Main/HomePage/Controller/CNMetaCodeHomePageController.swift
@@ -7,8 +7,8 @@ @@ -7,8 +7,8 @@
7 7
8 import Foundation 8 import Foundation
9 import UIKit 9 import UIKit
10 -import YYCategories  
11 import SwiftGifOrigin 10 import SwiftGifOrigin
  11 +import CNLiveRequestBastKit
12 12
13 let Width: CGFloat = UIScreen.main.bounds.size.width 13 let Width: CGFloat = UIScreen.main.bounds.size.width
14 let Height: CGFloat = UIScreen.main.bounds.size.height 14 let Height: CGFloat = UIScreen.main.bounds.size.height
@@ -98,7 +98,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel @@ -98,7 +98,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel
98 private var tabBarY:CGFloat = 0.0 98 private var tabBarY:CGFloat = 0.0
99 99
100 ///用户身份认证状态 100 ///用户身份认证状态
101 - private var identityStatus: UserIdentityStatus = .haveBeenCertified 101 + private var identityStatus: UserIdentityStatus = .notCertified
102 102
103 // MARK: - 懒加载 103 // MARK: - 懒加载
104 ///数据源 104 ///数据源
@@ -139,9 +139,11 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel @@ -139,9 +139,11 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel
139 self.tabBarY = (self.tabBarController?.tabBar.top)! 139 self.tabBarY = (self.tabBarController?.tabBar.top)!
140 140
141 141
142 - for i in (0..<5) {  
143 - self.dataArray.add("122")  
144 - } 142 +// for i in (0..<5) {
  143 +// self.dataArray.add("122")
  144 +// }
  145 +
  146 + self.getUserIdentityApi()
145 147
146 self.setupUI() 148 self.setupUI()
147 149
@@ -154,14 +156,52 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel @@ -154,14 +156,52 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel
154 156
155 print("uid = ",UserInfoManager.shared.userInfo.uid) 157 print("uid = ",UserInfoManager.shared.userInfo.uid)
156 print("1111") 158 print("1111")
  159 +
  160 +// let db = CNIdentityDB()
  161 +//
  162 +//
  163 +// let model = CNIdentityModel()
  164 +// model.id = "q_123"
  165 +// model.name = "小米"
  166 +// db.insterObject(object: model)
  167 +//
  168 +// let model2 = CNIdentityModel()
  169 +// model2.id = "a_451"
  170 +// model2.name = "小明"
  171 +// db.insterObject(object: model2)
  172 +//
  173 +// let model4 = CNIdentityModel()
  174 +// model4.id = "3_234"
  175 +// model4.name = "小张"
  176 +// db.insterObject(object: model4)
  177 +//
  178 +//
  179 +// let time:DispatchTime = DispatchTime.now() + 2.0
  180 +// DispatchQueue.main.asyncAfter(deadline: time, execute: DispatchWorkItem(block: {
  181 +//
  182 +// let modelNew = CNIdentityModel()
  183 +// modelNew.id = "a_451"
  184 +// modelNew.name = "小张"
  185 +// modelNew.icon = "http://apple.com"
  186 +// modelNew.createTime = "1234555223"
  187 +// modelNew.enable = true
  188 +// db.updateObject(newObject: modelNew)
  189 +//
  190 +// let allData = CNIdentityDB().searchAllObject()
  191 +// print(allData)
  192 +//
  193 +// }))
  194 +
  195 +
157 } 196 }
158 override func viewDidAppear(_ animated: Bool) { 197 override func viewDidAppear(_ animated: Bool) {
159 super.viewDidAppear(animated) 198 super.viewDidAppear(animated)
160 self.view.height = KSreenHeight 199 self.view.height = KSreenHeight
161 200
162 self.topNavView.isHidden = true 201 self.topNavView.isHidden = true
163 -  
164 } 202 }
  203 +
  204 +
165 // MARK: - 添加UI 205 // MARK: - 添加UI
166 func setupUI(){ 206 func setupUI(){
167 self.view.backgroundColor = KVCBackgroupColor 207 self.view.backgroundColor = KVCBackgroupColor
@@ -344,5 +384,27 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel @@ -344,5 +384,27 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel
344 } 384 }
345 } 385 }
346 } 386 }
  387 + //MARK: - 网络请求
  388 + func getUserIdentityApi(){
  389 + CNHomePageViewModel.getUserIdentityApi { listArray, responseType, errorMsg in
  390 + switch responseType{
  391 + case .success:
  392 + if(listArray.count>0){
  393 + self.addCertificationView.isHidden = true
  394 + self.addCertificationView.removeFromSuperview()
  395 + self.dataArray.addObjects(from: listArray)
  396 + self.addPageView()
  397 + self.identityStatus = .haveBeenCertified
  398 + }else{
  399 + self.identityStatus = .notCertified
  400 + }
  401 +
  402 + case .failed:
  403 + showMessage(message: errorMsg)
  404 + case .noNetwork:
  405 + showMessage(message: "网络未连接")
  406 + }
  407 + }
  408 + }
347 409
348 } 410 }
metaCode/Classes/Main/HomePage/View/CNDownSlideView.swift
@@ -7,7 +7,6 @@ @@ -7,7 +7,6 @@
7 7
8 import Foundation 8 import Foundation
9 import UIKit 9 import UIKit
10 -import YYCategories  
11 10
12 typealias backBlock = ()->Void; 11 typealias backBlock = ()->Void;
13 12
metaCode/Classes/Main/HomePage/View/CNDownSlideViewRemindView.swift
@@ -6,7 +6,6 @@ @@ -6,7 +6,6 @@
6 // 6 //
7 7
8 import Foundation 8 import Foundation
9 -import YYCategories  
10 9
11 ///下滑显示提醒View 10 ///下滑显示提醒View
12 class CNDownSlideViewRemindView : UIView{ 11 class CNDownSlideViewRemindView : UIView{
metaCode/Classes/Main/HomePage/View/CNMainView.swift
@@ -6,7 +6,6 @@ @@ -6,7 +6,6 @@
6 // 6 //
7 7
8 import Foundation 8 import Foundation
9 -import YYCategories  
10 9
11 ///旋转动画时间 10 ///旋转动画时间
12 let KTransformAnimationTime:CGFloat = 0.75; 11 let KTransformAnimationTime:CGFloat = 0.75;
metaCode/Classes/Main/HomePage/View/CNUpSlideView.swift
@@ -6,7 +6,6 @@ @@ -6,7 +6,6 @@
6 // 6 //
7 7
8 import Foundation 8 import Foundation
9 -import YYCategories  
10 import WebKit 9 import WebKit
11 10
12 ///上滑显示的VIew 11 ///上滑显示的VIew
metaCode/Classes/Main/HomePage/View/CNUpSlideViewRemindView.swift
@@ -6,7 +6,6 @@ @@ -6,7 +6,6 @@
6 // 6 //
7 7
8 import Foundation 8 import Foundation
9 -import YYCategories  
10 9
11 /// 上拉显示提醒View 10 /// 上拉显示提醒View
12 class CNUpSlideViewRemindView:UIView{ 11 class CNUpSlideViewRemindView:UIView{
metaCode/Classes/Main/HomePage/ViewModel/CNHomePageViewModel.swift 0 → 100644
  1 +//
  2 +// CNHomePageViewModel.swift
  3 +// metaCode
  4 +//
  5 +// Created by daojian on 2023/7/3.
  6 +//
  7 +
  8 +import Foundation
  9 +import CNLiveRequestBastKit
  10 +
  11 +///请求响应回调
  12 +typealias responseBlock = (_ listArray:Array<CNIdentityModel>, _ responseType:CNNetworkingResponseType, _ errorMsg:String) -> Void
  13 +
  14 +class CNHomePageViewModel:NSObject {
  15 +
  16 + /// 获取身份列表
  17 + class func getUserIdentityApi(resultBlock:@escaping responseBlock){
  18 +
  19 + //先从本地获取,本地有直接返回
  20 + let db = CNIdentityDB()
  21 + let allDbArray = db.searchAllObject()
  22 + if(allDbArray.count > 0){
  23 + resultBlock(allDbArray,.success,"")
  24 + return
  25 + }
  26 +
  27 + //从网络获取
  28 + CNLiveNetworking.setAllowRequestDefaultArgument(false)
  29 + CNLiveNetworking.setupShowDataResult(false)
  30 + CNLiveNetworking.requestNetwork(with: .GET, urlString: "\(APPBaseMCUrl)/identityApi/list?sid=\(UserInfoManager.shared.userInfo.uid)&page=1&pageSize=1000", param: nil, cacheType: .networkOnly) { task , result, error in
  31 +
  32 + if((error) != nil){
  33 + //网络请求失败
  34 + if CNLiveNetworking.isNetworking(){
  35 + resultBlock([],.failed,error?.localizedDescription ?? "请求失败")
  36 + }else{
  37 + resultBlock([],.noNetwork,"无网络连接")
  38 + }
  39 + return
  40 + }
  41 +
  42 + let resultDic:NSDictionary = result as! NSDictionary
  43 +
  44 + let errorCode:String = "\(resultDic["errorCode"]!)"
  45 + if (errorCode == "0"){
  46 + let data:NSDictionary = resultDic["data"] as! NSDictionary
  47 + let list:NSArray = data["list"] as! NSArray
  48 +
  49 + //list数据转CNIdentityModel, 并把model存入本地
  50 +
  51 + var array:Array = Array<CNIdentityModel>()
  52 + for index in 0..<list.count{
  53 + let item = dictionaryToModel(list[index] as! [String : Any], CNIdentityModel.self, "")
  54 + array.append(item as! CNIdentityModel)
  55 + //存入数据库
  56 + db.insterObject(object: item as! CNIdentityModel)
  57 + }
  58 + resultBlock(array,.success,"")
  59 + }
  60 + else{
  61 + let errorMessage:String = resultDic["errorMessage"] as! String
  62 + showMessage(message: errorMessage)
  63 + resultBlock([],.failed,errorMessage)
  64 + }
  65 +
  66 + }
  67 +
  68 + }
  69 +
  70 +
  71 +}
metaCode/Classes/Main/LoginPage/ViewModel/CNLiveLoginViewModel.swift
@@ -6,7 +6,6 @@ @@ -6,7 +6,6 @@
6 // 6 //
7 7
8 import Foundation 8 import Foundation
9 -import YYCategories  
10 import CNLiveRequestBastKit 9 import CNLiveRequestBastKit
11 import HandyJSON 10 import HandyJSON
12 11
metaCode/Classes/Main/MinePage/Controller/CNLiveInfoShowViewController.swift
@@ -6,7 +6,6 @@ @@ -6,7 +6,6 @@
6 // 6 //
7 7
8 import Foundation 8 import Foundation
9 -import YYCategories  
10 import WebKit 9 import WebKit
11 10
12 enum ListShowInfoType { 11 enum ListShowInfoType {
metaCode/Classes/Other/AppDelegate.swift
@@ -57,7 +57,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { @@ -57,7 +57,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
57 CNLiveNetworking.setupSignKey(APPKey) 57 CNLiveNetworking.setupSignKey(APPKey)
58 CNLiveNetworking.setAllowRequestDefaultArgument(true) 58 CNLiveNetworking.setAllowRequestDefaultArgument(true)
59 CNLiveNetworking.setResponseSerializerType(.JSON) 59 CNLiveNetworking.setResponseSerializerType(.JSON)
60 - CNLiveNetworking.setupBaseURL(APPBaseUrl) 60 + CNLiveNetworking.setupBaseURL(APPLoginHost)
61 } 61 }
62 62
63 63
metaCode/Classes/Vendors/NewPagedFlowView.m
@@ -11,7 +11,6 @@ @@ -11,7 +11,6 @@
11 #import "NewPagedFlowView.h" 11 #import "NewPagedFlowView.h"
12 12
13 //#import<CNLiveCommonCategory/UIColor+CNLiveExtension.h> 13 //#import<CNLiveCommonCategory/UIColor+CNLiveExtension.h>
14 -//#import<YYCategories/YYCategories.h>  
15 14
16 @interface NewPagedFlowView () 15 @interface NewPagedFlowView ()
17 16