Steven 1 年間 前
コミット
6e7608b976
45 ファイル変更439 行追加90 行削除
  1. 92 52
      KulexiuForTeacher/KulexiuForTeacher.xcodeproj/project.pbxproj
  2. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AccompanyWebView/AccompanyLoadingView.h
  3. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AccompanyWebView/AccompanyLoadingView.m
  4. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AccompanyWebView/AccompanyLoadingView.xib
  5. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AccompanyWebView/KSAccompanyWebViewController.h
  6. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AccompanyWebView/KSAccompanyWebViewController.m
  7. 25 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AccompanyWebView/KSCloudWebManager.h
  8. 280 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AccompanyWebView/KSCloudWebManager.m
  9. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/BaseAlertView.h
  10. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/BaseAlertView.m
  11. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSNewConfirmAlertView.h
  12. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSNewConfirmAlertView.m
  13. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSNewConfirmAlertView.xib
  14. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSPublicAlertView.h
  15. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSPublicAlertView.m
  16. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSPublicAlertView.xib
  17. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSTipsAlert.h
  18. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSTipsAlert.m
  19. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSTipsAlert.xib
  20. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSUpdateAlert.h
  21. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSUpdateAlert.m
  22. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSUpdateAlert.xib
  23. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSUpdateManager.h
  24. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSUpdateManager.m
  25. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/BaseViewContolller/BaseViewController.h
  26. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/BaseViewContolller/BaseViewController.m
  27. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/BaseViewContolller/KSBaseViewController.h
  28. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/BaseViewContolller/KSBaseViewController.m
  29. 0 17
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSBaseModel.h
  30. 0 13
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSBaseModel.m
  31. 4 1
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/LoginManger/KSLoginManager.m
  32. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/NavigationController/CustomNavViewController.h
  33. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/NavigationController/CustomNavViewController.m
  34. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/TabbarController/KSBaseTableViewController.h
  35. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/TabbarController/KSBaseTableViewController.m
  36. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/TabbarController/KSTabBarViewController.h
  37. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/TabbarController/KSTabBarViewController.m
  38. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/WebView/KSBaseWKWebViewController.h
  39. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/WebView/KSBaseWKWebViewController.m
  40. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/WebView/KSLocalWebViewController.h
  41. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/WebView/KSLocalWebViewController.m
  42. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/WebView/KSWebLoadRefreshView.h
  43. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/WebView/KSWebLoadRefreshView.m
  44. 0 0
      KulexiuForTeacher/KulexiuForTeacher/Common/Base/WebView/KSWebLoadRefreshView.xib
  45. 38 7
      KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/NewWhiteboard/KSNewWhiteBoard.m

+ 92 - 52
KulexiuForTeacher/KulexiuForTeacher.xcodeproj/project.pbxproj

@@ -147,7 +147,6 @@
 		2779334327E3147C0010E277 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2779334227E3147B0010E277 /* OpenGLES.framework */; };
 		2779334527E314870010E277 /* VideoToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2779334427E314870010E277 /* VideoToolbox.framework */; };
 		2779334727E3148E0010E277 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2779334627E3148E0010E277 /* GLKit.framework */; };
-		2779335C27E317CD0010E277 /* KSBaseModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 2779335A27E317CC0010E277 /* KSBaseModel.m */; };
 		277935DF27E326DA0010E277 /* KSNetTypeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 277935DD27E326D90010E277 /* KSNetTypeManager.m */; };
 		277935E227E327F00010E277 /* KSTabBarViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 277935E127E327F00010E277 /* KSTabBarViewController.m */; };
 		277935E527E328C00010E277 /* CustomNavViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 277935E427E328C00010E277 /* CustomNavViewController.m */; };
@@ -502,6 +501,7 @@
 		BC3A55652BAA798A002E1616 /* CloudAccompanyLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC3A55622BAA798A002E1616 /* CloudAccompanyLibrary.framework */; };
 		BC3A55662BAA799B002E1616 /* KSTunerLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC3A55612BAA798A002E1616 /* KSTunerLibrary.framework */; };
 		BC3A55672BAA799C002E1616 /* KSTunerLibrary.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = BC3A55612BAA798A002E1616 /* KSTunerLibrary.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
+		BC3A557F2BAA8F26002E1616 /* KSCloudWebManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BC3A557E2BAA8F26002E1616 /* KSCloudWebManager.m */; };
 		BC3ACD942890D60800060E97 /* FreezeListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC3ACD932890D60800060E97 /* FreezeListViewController.m */; };
 		BC3ACD972890D61400060E97 /* NoRecordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC3ACD962890D61400060E97 /* NoRecordViewController.m */; };
 		BC3ACD9A2890D88600060E97 /* IncomeRecordHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC3ACD992890D88600060E97 /* IncomeRecordHeadView.m */; };
@@ -1339,8 +1339,6 @@
 		2779334227E3147B0010E277 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
 		2779334427E314870010E277 /* VideoToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = VideoToolbox.framework; path = System/Library/Frameworks/VideoToolbox.framework; sourceTree = SDKROOT; };
 		2779334627E3148E0010E277 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; };
-		2779335A27E317CC0010E277 /* KSBaseModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSBaseModel.m; sourceTree = "<group>"; };
-		2779335B27E317CD0010E277 /* KSBaseModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSBaseModel.h; sourceTree = "<group>"; };
 		277935DD27E326D90010E277 /* KSNetTypeManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSNetTypeManager.m; sourceTree = "<group>"; };
 		277935DE27E326DA0010E277 /* KSNetTypeManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSNetTypeManager.h; sourceTree = "<group>"; };
 		277935E027E327F00010E277 /* KSTabBarViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KSTabBarViewController.h; sourceTree = "<group>"; };
@@ -1946,6 +1944,8 @@
 		BC3A55602BAA7989002E1616 /* KSToolLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = KSToolLibrary.framework; sourceTree = "<group>"; };
 		BC3A55612BAA798A002E1616 /* KSTunerLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = KSTunerLibrary.framework; sourceTree = "<group>"; };
 		BC3A55622BAA798A002E1616 /* CloudAccompanyLibrary.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CloudAccompanyLibrary.framework; sourceTree = "<group>"; };
+		BC3A557D2BAA8F25002E1616 /* KSCloudWebManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSCloudWebManager.h; sourceTree = "<group>"; };
+		BC3A557E2BAA8F26002E1616 /* KSCloudWebManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSCloudWebManager.m; sourceTree = "<group>"; };
 		BC3ACD922890D60800060E97 /* FreezeListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FreezeListViewController.h; sourceTree = "<group>"; };
 		BC3ACD932890D60800060E97 /* FreezeListViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FreezeListViewController.m; sourceTree = "<group>"; };
 		BC3ACD952890D61400060E97 /* NoRecordViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NoRecordViewController.h; sourceTree = "<group>"; };
@@ -3173,6 +3173,12 @@
 		2779309627E30F2D0010E277 /* Base */ = {
 			isa = PBXGroup;
 			children = (
+				BC3A557B2BAA8633002E1616 /* AlertView */,
+				BC3A55782BAA8633002E1616 /* AccompanyWebView */,
+				BC3A557A2BAA8633002E1616 /* BaseViewContolller */,
+				BC3A55772BAA8633002E1616 /* NavigationController */,
+				BC3A557C2BAA8633002E1616 /* TabbarController */,
+				BC3A55792BAA8633002E1616 /* WebView */,
 				BC3BF6352B9ED1F600831494 /* StateView.h */,
 				BC3BF6342B9ED1F600831494 /* StateView.m */,
 				BC38C4882AFA207A00ABFCC2 /* KSEmptyStatusView.h */,
@@ -3182,38 +3188,6 @@
 				BC28884B2A80DA530064B773 /* LoginManger */,
 				BCC583D328A9FA8100BAB4CF /* CloudLoadingSource */,
 				BC71D28A288811BF0010F14B /* TabbarAnimation */,
-				BC023801286594EA005560CA /* KSTipsAlert.h */,
-				BC023800286594EA005560CA /* KSTipsAlert.m */,
-				BC0237FF286594EA005560CA /* KSTipsAlert.xib */,
-				2779361C27E3338D0010E277 /* KSUpdateManager.h */,
-				2779361D27E3338E0010E277 /* KSUpdateManager.m */,
-				2779362027E334450010E277 /* KSUpdateAlert.h */,
-				2779362127E334460010E277 /* KSUpdateAlert.m */,
-				2779361F27E334450010E277 /* KSUpdateAlert.xib */,
-				2779335B27E317CD0010E277 /* KSBaseModel.h */,
-				2779335A27E317CC0010E277 /* KSBaseModel.m */,
-				2779309727E30F480010E277 /* BaseViewController.h */,
-				2779309827E30F480010E277 /* BaseViewController.m */,
-				277935E627E32A450010E277 /* KSBaseViewController.h */,
-				277935E727E32A450010E277 /* KSBaseViewController.m */,
-				277935E927E32A930010E277 /* KSBaseWKWebViewController.h */,
-				277935EA27E32A930010E277 /* KSBaseWKWebViewController.m */,
-				BC0D951A2AC2868400E54D3F /* KSWebLoadRefreshView.h */,
-				BC0D951B2AC2868400E54D3F /* KSWebLoadRefreshView.m */,
-				BC0D951C2AC2868400E54D3F /* KSWebLoadRefreshView.xib */,
-				275B172527EB1C6C0081FDEF /* KSBaseTableViewController.h */,
-				275B172427EB1C6B0081FDEF /* KSBaseTableViewController.m */,
-				275FA19E27E7250700CFEA2E /* KSAccompanyWebViewController.h */,
-				275FA19F27E7250700CFEA2E /* KSAccompanyWebViewController.m */,
-				BCC5841428A9FA9D00BAB4CF /* AccompanyLoadingView.h */,
-				BCC5841528A9FA9D00BAB4CF /* AccompanyLoadingView.m */,
-				BCC5841328A9FA9D00BAB4CF /* AccompanyLoadingView.xib */,
-				275FA19527E723D600CFEA2E /* KSLocalWebViewController.h */,
-				275FA19627E723D700CFEA2E /* KSLocalWebViewController.m */,
-				277935E327E328C00010E277 /* CustomNavViewController.h */,
-				277935E427E328C00010E277 /* CustomNavViewController.m */,
-				277935E027E327F00010E277 /* KSTabBarViewController.h */,
-				277935E127E327F00010E277 /* KSTabBarViewController.m */,
 				277935DE27E326DA0010E277 /* KSNetTypeManager.h */,
 				277935DD27E326D90010E277 /* KSNetTypeManager.m */,
 				2779331B27E311A10010E277 /* KSNetworkingManager.h */,
@@ -3223,14 +3197,6 @@
 				BCA9CE1627FD339D00D558C6 /* AuthDisplayView.xib */,
 				BC332DB2284866BE005AEF95 /* KSOrderManager.h */,
 				BC332DB1284866BE005AEF95 /* KSOrderManager.m */,
-				BC32E107286AB142001434DD /* BaseAlertView.h */,
-				BC32E108286AB142001434DD /* BaseAlertView.m */,
-				BC32E10A286AB31C001434DD /* KSPublicAlertView.h */,
-				BC32E10B286AB31C001434DD /* KSPublicAlertView.m */,
-				BC32E10D286AB326001434DD /* KSPublicAlertView.xib */,
-				BC86CB152AC2E72000450EED /* KSNewConfirmAlertView.h */,
-				BC86CB162AC2E72000450EED /* KSNewConfirmAlertView.m */,
-				BC86CB182AC2E72500450EED /* KSNewConfirmAlertView.xib */,
 			);
 			path = Base;
 			sourceTree = "<group>";
@@ -4936,7 +4902,6 @@
 			isa = PBXGroup;
 			children = (
 				BC38C4002AF900E100ABFCC2 /* AudioMerge */,
-				BC38C41C2AF900E100ABFCC2 /* MediaEditor */,
 			);
 			path = MediaMerge;
 			sourceTree = "<group>";
@@ -4989,13 +4954,6 @@
 			path = AudioPlayAnimationView;
 			sourceTree = "<group>";
 		};
-		BC38C41C2AF900E100ABFCC2 /* MediaEditor */ = {
-			isa = PBXGroup;
-			children = (
-			);
-			path = MediaEditor;
-			sourceTree = "<group>";
-		};
 		BC38C4642AFA1F4B00ABFCC2 /* Works */ = {
 			isa = PBXGroup;
 			children = (
@@ -5067,6 +5025,88 @@
 			path = View;
 			sourceTree = "<group>";
 		};
+		BC3A55772BAA8633002E1616 /* NavigationController */ = {
+			isa = PBXGroup;
+			children = (
+				277935E327E328C00010E277 /* CustomNavViewController.h */,
+				277935E427E328C00010E277 /* CustomNavViewController.m */,
+			);
+			path = NavigationController;
+			sourceTree = "<group>";
+		};
+		BC3A55782BAA8633002E1616 /* AccompanyWebView */ = {
+			isa = PBXGroup;
+			children = (
+				275FA19E27E7250700CFEA2E /* KSAccompanyWebViewController.h */,
+				275FA19F27E7250700CFEA2E /* KSAccompanyWebViewController.m */,
+				BCC5841428A9FA9D00BAB4CF /* AccompanyLoadingView.h */,
+				BCC5841528A9FA9D00BAB4CF /* AccompanyLoadingView.m */,
+				BCC5841328A9FA9D00BAB4CF /* AccompanyLoadingView.xib */,
+				BC3A557D2BAA8F25002E1616 /* KSCloudWebManager.h */,
+				BC3A557E2BAA8F26002E1616 /* KSCloudWebManager.m */,
+			);
+			path = AccompanyWebView;
+			sourceTree = "<group>";
+		};
+		BC3A55792BAA8633002E1616 /* WebView */ = {
+			isa = PBXGroup;
+			children = (
+				277935E927E32A930010E277 /* KSBaseWKWebViewController.h */,
+				277935EA27E32A930010E277 /* KSBaseWKWebViewController.m */,
+				BC0D951A2AC2868400E54D3F /* KSWebLoadRefreshView.h */,
+				BC0D951B2AC2868400E54D3F /* KSWebLoadRefreshView.m */,
+				BC0D951C2AC2868400E54D3F /* KSWebLoadRefreshView.xib */,
+				275FA19527E723D600CFEA2E /* KSLocalWebViewController.h */,
+				275FA19627E723D700CFEA2E /* KSLocalWebViewController.m */,
+			);
+			path = WebView;
+			sourceTree = "<group>";
+		};
+		BC3A557A2BAA8633002E1616 /* BaseViewContolller */ = {
+			isa = PBXGroup;
+			children = (
+				2779309727E30F480010E277 /* BaseViewController.h */,
+				2779309827E30F480010E277 /* BaseViewController.m */,
+				277935E627E32A450010E277 /* KSBaseViewController.h */,
+				277935E727E32A450010E277 /* KSBaseViewController.m */,
+			);
+			path = BaseViewContolller;
+			sourceTree = "<group>";
+		};
+		BC3A557B2BAA8633002E1616 /* AlertView */ = {
+			isa = PBXGroup;
+			children = (
+				BC023801286594EA005560CA /* KSTipsAlert.h */,
+				BC023800286594EA005560CA /* KSTipsAlert.m */,
+				BC0237FF286594EA005560CA /* KSTipsAlert.xib */,
+				2779361C27E3338D0010E277 /* KSUpdateManager.h */,
+				2779361D27E3338E0010E277 /* KSUpdateManager.m */,
+				2779362027E334450010E277 /* KSUpdateAlert.h */,
+				2779362127E334460010E277 /* KSUpdateAlert.m */,
+				2779361F27E334450010E277 /* KSUpdateAlert.xib */,
+				BC32E107286AB142001434DD /* BaseAlertView.h */,
+				BC32E108286AB142001434DD /* BaseAlertView.m */,
+				BC32E10A286AB31C001434DD /* KSPublicAlertView.h */,
+				BC32E10B286AB31C001434DD /* KSPublicAlertView.m */,
+				BC32E10D286AB326001434DD /* KSPublicAlertView.xib */,
+				BC86CB152AC2E72000450EED /* KSNewConfirmAlertView.h */,
+				BC86CB162AC2E72000450EED /* KSNewConfirmAlertView.m */,
+				BC86CB182AC2E72500450EED /* KSNewConfirmAlertView.xib */,
+			);
+			path = AlertView;
+			sourceTree = "<group>";
+		};
+		BC3A557C2BAA8633002E1616 /* TabbarController */ = {
+			isa = PBXGroup;
+			children = (
+				275B172527EB1C6C0081FDEF /* KSBaseTableViewController.h */,
+				275B172427EB1C6B0081FDEF /* KSBaseTableViewController.m */,
+				277935E027E327F00010E277 /* KSTabBarViewController.h */,
+				277935E127E327F00010E277 /* KSTabBarViewController.m */,
+			);
+			path = TabbarController;
+			sourceTree = "<group>";
+		};
 		BC3BF61A2B9EAE7A00831494 /* ToolKit */ = {
 			isa = PBXGroup;
 			children = (
@@ -7530,6 +7570,7 @@
 				BC0A22A6284751F80065C1AB /* DownloadStatusCell.m in Sources */,
 				2779326F27E30FD80010E277 /* FSCalendarHeaderView.m in Sources */,
 				275E3DF727F467ED0010EC30 /* LiveRoomLikeLayer.m in Sources */,
+				BC3A557F2BAA8F26002E1616 /* KSCloudWebManager.m in Sources */,
 				BC38C42D2AF900E100ABFCC2 /* KSPlayerSliderView.m in Sources */,
 				BC71DE922A89C937003F165E /* TXClassroomTextMsg.m in Sources */,
 				BC38C4232AF900E100ABFCC2 /* UIView+KSCovertImage.m in Sources */,
@@ -7572,7 +7613,6 @@
 				BCE73D692ABD705F00AD1F9A /* HomeMusicSheetLayout.m in Sources */,
 				BCD6D16228195A17009A773E /* WithdrawApplyViewController.m in Sources */,
 				BC106B8C2A8F4586000759A9 /* TXLiveMessageSeatResponse.m in Sources */,
-				2779335C27E317CD0010E277 /* KSBaseModel.m in Sources */,
 				BC7CFFB72817E90700CAEB21 /* KSSegView.m in Sources */,
 				BC9AA0C12ABC3C5800CD954D /* ChatComplainBottomView.m in Sources */,
 				BC71DF112A89F470003F165E /* TXMetronomeAlertView.m in Sources */,

+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/AccompanyLoadingView.h → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AccompanyWebView/AccompanyLoadingView.h


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/AccompanyLoadingView.m → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AccompanyWebView/AccompanyLoadingView.m


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/AccompanyLoadingView.xib → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AccompanyWebView/AccompanyLoadingView.xib


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSAccompanyWebViewController.h → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AccompanyWebView/KSAccompanyWebViewController.h


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSAccompanyWebViewController.m → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AccompanyWebView/KSAccompanyWebViewController.m


+ 25 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/AccompanyWebView/KSCloudWebManager.h

@@ -0,0 +1,25 @@
+//
+//  KSCloudWebManager.h
+//  KulexiuSchoolStudent
+//
+//  Created by 王智 on 2024/1/19.
+//
+
+#import <Foundation/Foundation.h>
+#import "CustomNavViewController.h"
+
+#define CLOUDWEB_MANAGER ([KSCloudWebManager shareInstance])
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface KSCloudWebManager : NSObject
+
++ (instancetype)shareInstance;
+
+- (void)configCloudWebSource;
+
+- (void)showWebView:(NSDictionary *)parm fromController:(CustomNavViewController *)navCtrl;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 280 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/AccompanyWebView/KSCloudWebManager.m

@@ -0,0 +1,280 @@
+//
+//  KSCloudWebManager.m
+//  KulexiuSchoolStudent
+//
+//  Created by 王智 on 2024/1/19.
+//
+
+#import "KSCloudWebManager.h"
+#import <CloudAccompanyLibrary/CloudWebConfig.h>
+#import <CloudAccompanyLibrary/KSCloudWebViewController.h>
+#import <KSToolLibrary/RecordCheckManager.h>
+#import "KSPremissionAlert.h"
+#import "KSBaseWKWebViewController.h"
+#import "KSMediaMergeView.h"
+#import <KSToolLibrary/UIDevice+TFDevice.h>
+#import "AppDelegate+AppService.h"
+#import "AccompanyLoadingView.h"
+#import "KSWebLoadRefreshView.h"
+
+@interface KSCloudWebManager ()<KSCloudWebViewControllerDelegate>
+
+@property (nonatomic, strong) AccompanyLoadingView *customLoading;
+
+@property (nonatomic, strong) KSWebLoadRefreshView *errorView;
+
+@end
+
+@implementation KSCloudWebManager
+
++ (instancetype)shareInstance {
+    
+    static KSCloudWebManager *manager = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        manager = [[KSCloudWebManager alloc] init];
+    });
+    return manager;
+}
+
+
+- (void)configCloudWebSource {
+    CLOUD_CONFIG.scrpit_name = SCRIPT_NAME;
+    CLOUD_CONFIG.agent_name = AGENT_NAME;
+    CLOUD_CONFIG.agent_domain = AGENT_DOMAIN;
+    CLOUD_CONFIG.token_type = UserDefault(Token_type);
+    CLOUD_CONFIG.current_token = UserDefault(TokenKey);
+    CLOUD_CONFIG.user_ID = UserDefault(UIDKey);
+    CLOUD_CONFIG.socket_host = SOCKET_URL;
+    CLOUD_CONFIG.authFilePath = CERT_PATH;
+    CLOUD_CONFIG.need_auth = SSL_AUTH;
+    CLOUD_CONFIG.themeColor = THEMECOLOR;
+    CLOUD_CONFIG.soundFilePath = [[NSBundle mainBundle] pathForResource:@"synthgms" ofType:@"sf2"];
+}
+
+- (void)showWebView:(NSDictionary *)parm fromController:(CustomNavViewController *)navCtrl {
+    PREMISSIONTYPE micEnable = [RecordCheckManager checkMicPermissionAvaiable];
+    PREMISSIONTYPE cameraEnable = [RecordCheckManager checkCameraPremissionAvaiable];
+    if (micEnable == PREMISSIONTYPE_YES && cameraEnable == PREMISSIONTYPE_YES) { //
+        KSCloudWebViewController *ctrl = [[KSCloudWebViewController alloc] init];
+        ctrl.webViewDelegate = self;
+        ctrl.url = [parm ks_stringValueForKey:@"url"];
+        ctrl.parmDic = parm;
+        NSInteger orientation = [parm ks_integerValueForKey:@"orientation"];
+        BOOL isLandScape = orientation == 0 ? YES : NO;
+        ctrl.ks_landScape = isLandScape;
+        [navCtrl pushViewController:ctrl animated:YES];
+    }
+    else {
+        if (micEnable == PREMISSIONTYPE_NO && cameraEnable == PREMISSIONTYPE_NO) { // 如果麦克风权限和摄像头权限都没有
+            [self showAlertWithMessage:@"请开启相机和麦克风访问权限" type:CHECKDEVICETYPE_BOTH];
+        }
+        else if (micEnable == PREMISSIONTYPE_NO) { // 如果没有麦克风权限
+            [self showAlertWithMessage:@"请开启麦克风访问权限" type:CHECKDEVICETYPE_MIC];
+        }
+        else if (cameraEnable == PREMISSIONTYPE_NO) { // 如果没有摄像头权限
+            [self showAlertWithMessage:@"请开启相机访问权限" type:CHECKDEVICETYPE_CAMREA];
+        }
+    }
+}
+
+- (void)showAlertWithMessage:(NSString *)message type:(CHECKDEVICETYPE)deviceType {
+    [KSPremissionAlert shareInstanceDisplayImage:deviceType message:message showInView:[NSObject getKeyWindow] cancel:^{
+        
+    } confirm:^{
+        [self openSettingView];
+    }];
+    
+}
+
+- (void)openSettingView {
+    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:nil];
+}
+
+// 回调权限
+- (void)NotiferShowPremissAlert:(NSString *)message {
+    [KSPremissionAlert shareInstanceDisplayImage:CHECKDEVICETYPE_BOTH message:message showInView:[NSObject getKeyWindow] cancel:^{
+        
+    } confirm:^{
+        [self openSettingView];
+    }];
+}
+
+// 下载
+- (void)notiferDownloadFileUrl:(NSString *)url success:(void (^)(NSURL * _Nonnull, NSString * _Nonnull))success faliure:(void (^)(void))faliure {
+    [KSNetworkingManager downloadFileRequestWithFileUrl:url progress:^(int64_t bytesRead, int64_t totalBytes) {
+        
+    } success:^(NSURL * _Nonnull fileUrl) {
+        if (success) {
+            success(fileUrl,url);
+        }
+    } faliure:^(NSError * _Nonnull error) {
+        if (faliure) {
+            faliure();
+        }
+    }];
+}
+
+// 上传
+- (void)uploadFile:(NSString *)uploadFileUrl success:(void (^)(NSString * _Nonnull))success faliure:(void (^)(NSString * _Nonnull))faliure {
+    [LOADING_MANAGER showCustomLoading:@"上传中..."];
+    NSData *fileData = [NSData dataWithContentsOfURL:[NSURL fileURLWithPath:uploadFileUrl]];
+    NSString *suffix = [NSString stringWithFormat:@".%@",[uploadFileUrl pathExtension]];
+    [UPLOAD_MANAGER configWithfilePath:@"/user/"];
+    [UPLOAD_MANAGER videoUpload:fileData fileName:@"video" fileSuffix:suffix progress:^(int64_t bytesWritten, int64_t totalBytes) {
+        // 显示进度
+        int progress = (int)(bytesWritten / totalBytes * 100);
+        __block NSString *tipsMessage = [NSString stringWithFormat:@"上传中 %d%%",progress];
+        dispatch_main_async_safe(^{
+            [LOADING_MANAGER.loadingView setDisplayText:tipsMessage];
+        });
+    } successCallback:^(NSMutableArray * _Nonnull fileUrlArray) {
+        [LOADING_MANAGER removeCustomLoading];
+        NSString *fileUrl = [fileUrlArray lastObject];
+        success(fileUrl);
+        
+    } faliure:^(NSError * _Nullable error, NSString * _Nullable descMessaeg) {
+        [LOADING_MANAGER removeCustomLoading];
+        faliure(descMessaeg);
+    }];
+}
+#pragma mark ------- KSCloudWebViewControllerDelegate
+
+- (void)openWebViewWithParm:(NSDictionary *)parm inNavController:(UINavigationController *)navController {
+    KSBaseWKWebViewController *detailCtrl = [[KSBaseWKWebViewController alloc] init];
+    detailCtrl.url = [parm ks_stringValueForKey:@"url"];
+    detailCtrl.parmDic = parm;
+    NSInteger orientation = [parm ks_integerValueForKey:@"orientation"];
+    BOOL isLandScape = orientation == 0 ? YES : NO;
+    detailCtrl.ks_landScape = isLandScape;
+
+    [navController pushViewController:detailCtrl animated:YES];
+}
+
+- (void)showMergeViewWithParm:(NSDictionary *)parm displayInView:(UIView *)displayView callBackController:(KSCloudWebViewController *)controller {
+    KSMediaMergeView *mergeView = [[KSMediaMergeView alloc] init];
+    [displayView addSubview:mergeView];
+    [mergeView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.right.top.bottom.mas_equalTo(displayView);
+    }];
+    mergeView.recordId = [parm ks_stringValueForKey:@"recordId"];
+    mergeView.songName = [parm ks_stringValueForKey:@"title"];
+    mergeView.coverImage = [parm ks_stringValueForKey:@"coverImg"];
+    MJWeakSelf;
+    NSInteger defaultDelay = [parm ks_integerValueForKey:@"defaultDelay"];
+    NSURL *videoUrl = [parm valueForKey:@"videoUrl"];
+    NSURL *bgAudioUrl = [parm valueForKey:@"bgAudioUrl"];
+    NSURL *recordUrl = [parm valueForKey:@"recordUrl"];
+    NSString *accompanyUrl = [parm ks_stringValueForKey:@"remoteBgUrl"];
+    
+    [mergeView configWithVideoUrl:videoUrl bgAudioUrl:bgAudioUrl remoteBgUrl:accompanyUrl  recordUrl:recordUrl offsetTime:defaultDelay mergeCallback:^{
+        [weakSelf callBackMergeSuccess:controller];
+    }];
+}
+
+- (void)callBackMergeSuccess:(KSCloudWebViewController *)controller {
+    
+    [controller musicPublishCallBack];
+}
+
+- (void)changeCurrentPageLandScape:(BOOL)landScape changeController:(KSCloudWebViewController *)controller {
+    if (landScape) {
+        // 切换到横屏
+        if (IS_IPAD) {
+            controller.zh_statusBarHidden = YES;
+        }
+        AppDelegate* delegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
+        delegate.allowAutoRotate = YES;
+        [UIDevice switchNewOrientation:UIInterfaceOrientationLandscapeRight inController:controller];
+    }
+    else {
+        if (IS_IPAD) {
+            controller.zh_statusBarHidden = NO;
+        }
+        AppDelegate* delegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
+        delegate.allowAutoRotate = NO;
+        [UIDevice switchNewOrientation:UIInterfaceOrientationPortrait inController:controller];
+    }
+}
+
+- (void)notiferShowAICustomLoadingDisplayInView:(UIView *)view callBackController:(KSCloudWebViewController *)controller {
+    MJWeakSelf;
+    [self.customLoading loadingCallback:^{
+        [weakSelf notiferBack:controller];
+    }];
+    if ([view.subviews containsObject:self.customLoading]) {
+        return;
+    }
+    [view addSubview:self.customLoading];
+    [self.customLoading mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.top.right.bottom.mas_equalTo(view);
+    }];
+    [view bringSubviewToFront:self.customLoading];
+    [self.customLoading showLoading];
+}
+
+
+- (void)notiferRemoveAICustomLoading {
+    [self.customLoading stopLoading];
+    _customLoading = nil;
+}
+
+#pragma mark ---- error View
+- (void)notiferShowErrorViewDisplayInView:(UIView *)view callBackController:(KSCloudWebViewController *)controller {
+    MJWeakSelf;
+    [_errorView failViewActionCallback:^(BOOL isBack) {
+        [weakSelf hideErrorViewInView:view];
+        if (isBack) {
+            [weakSelf notiferBack:controller];
+        }
+        else {
+            [weakSelf notiferRefresh:controller];
+        }
+    }];
+}
+
+
+- (void)notiferRemoveErrorInView:(UIView *)view {
+    [self hideErrorViewInView:view];
+}
+
+- (void)hideErrorViewInView:(UIView *)view {
+    
+    if ([view.subviews containsObject:self.errorView]) {
+        [self.errorView removeFromSuperview];
+    }
+    _errorView = nil;
+}
+
+- (void)notiferRefresh:(KSCloudWebViewController *)controller {
+    [controller loadRequest];
+}
+
+#pragma mark ----- 小酷AI loading
+- (AccompanyLoadingView *)customLoading {
+    if (!_customLoading) {
+        _customLoading = [AccompanyLoadingView shareInstance];
+    }
+    return _customLoading;
+}
+
+- (void)notiferBack:(KSCloudWebViewController *)controller {
+    if (_customLoading) {
+        [self notiferRemoveAICustomLoading];
+    }
+    if (_errorView) {
+        [_errorView removeFromSuperview];
+        _errorView = nil;
+    }
+    [controller backAction];
+}
+
+#pragma mark --- web error
+- (KSWebLoadRefreshView *)errorView {
+    if (!_errorView) {
+        _errorView = [KSWebLoadRefreshView shareInstance];
+    }
+    return _errorView;
+}
+
+@end

+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/BaseAlertView.h → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/BaseAlertView.h


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/BaseAlertView.m → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/BaseAlertView.m


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSNewConfirmAlertView.h → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSNewConfirmAlertView.h


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSNewConfirmAlertView.m → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSNewConfirmAlertView.m


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSNewConfirmAlertView.xib → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSNewConfirmAlertView.xib


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSPublicAlertView.h → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSPublicAlertView.h


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSPublicAlertView.m → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSPublicAlertView.m


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSPublicAlertView.xib → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSPublicAlertView.xib


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSTipsAlert.h → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSTipsAlert.h


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSTipsAlert.m → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSTipsAlert.m


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSTipsAlert.xib → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSTipsAlert.xib


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSUpdateAlert.h → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSUpdateAlert.h


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSUpdateAlert.m → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSUpdateAlert.m


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSUpdateAlert.xib → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSUpdateAlert.xib


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSUpdateManager.h → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSUpdateManager.h


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSUpdateManager.m → KulexiuForTeacher/KulexiuForTeacher/Common/Base/AlertView/KSUpdateManager.m


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/BaseViewController.h → KulexiuForTeacher/KulexiuForTeacher/Common/Base/BaseViewContolller/BaseViewController.h


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/BaseViewController.m → KulexiuForTeacher/KulexiuForTeacher/Common/Base/BaseViewContolller/BaseViewController.m


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSBaseViewController.h → KulexiuForTeacher/KulexiuForTeacher/Common/Base/BaseViewContolller/KSBaseViewController.h


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSBaseViewController.m → KulexiuForTeacher/KulexiuForTeacher/Common/Base/BaseViewContolller/KSBaseViewController.m


+ 0 - 17
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSBaseModel.h

@@ -1,17 +0,0 @@
-//
-//  KSBaseModel.h
-//  StudentDaya
-//
-//  Created by Kyle on 2019/8/12.
-//  Copyright © 2019 DayaMusic. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface KSBaseModel : NSObject
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 13
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSBaseModel.m

@@ -1,13 +0,0 @@
-//
-//  KSBaseModel.m
-//  StudentDaya
-//
-//  Created by Kyle on 2019/8/12.
-//  Copyright © 2019 DayaMusic. All rights reserved.
-//
-
-#import "KSBaseModel.h"
-
-@implementation KSBaseModel
-
-@end

+ 4 - 1
KulexiuForTeacher/KulexiuForTeacher/Common/Base/LoginManger/KSLoginManager.m

@@ -89,7 +89,10 @@
             [UIDevice switchNewOrientation:UIInterfaceOrientationPortrait inController:logonVC];
         }
     }
-    
+    else if ([vc isKindOfClass:NSClassFromString(@"CustomNavViewController")]) {
+        CustomNavViewController *ctrl = (CustomNavViewController *)vc;
+        [ctrl popToRootViewControllerAnimated:YES];
+    }
 }
 
 - (NSString *)getVisableControllerName {

+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/CustomNavViewController.h → KulexiuForTeacher/KulexiuForTeacher/Common/Base/NavigationController/CustomNavViewController.h


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/CustomNavViewController.m → KulexiuForTeacher/KulexiuForTeacher/Common/Base/NavigationController/CustomNavViewController.m


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSBaseTableViewController.h → KulexiuForTeacher/KulexiuForTeacher/Common/Base/TabbarController/KSBaseTableViewController.h


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSBaseTableViewController.m → KulexiuForTeacher/KulexiuForTeacher/Common/Base/TabbarController/KSBaseTableViewController.m


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSTabBarViewController.h → KulexiuForTeacher/KulexiuForTeacher/Common/Base/TabbarController/KSTabBarViewController.h


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSTabBarViewController.m → KulexiuForTeacher/KulexiuForTeacher/Common/Base/TabbarController/KSTabBarViewController.m


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSBaseWKWebViewController.h → KulexiuForTeacher/KulexiuForTeacher/Common/Base/WebView/KSBaseWKWebViewController.h


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSBaseWKWebViewController.m → KulexiuForTeacher/KulexiuForTeacher/Common/Base/WebView/KSBaseWKWebViewController.m


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSLocalWebViewController.h → KulexiuForTeacher/KulexiuForTeacher/Common/Base/WebView/KSLocalWebViewController.h


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSLocalWebViewController.m → KulexiuForTeacher/KulexiuForTeacher/Common/Base/WebView/KSLocalWebViewController.m


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSWebLoadRefreshView.h → KulexiuForTeacher/KulexiuForTeacher/Common/Base/WebView/KSWebLoadRefreshView.h


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSWebLoadRefreshView.m → KulexiuForTeacher/KulexiuForTeacher/Common/Base/WebView/KSWebLoadRefreshView.m


+ 0 - 0
KulexiuForTeacher/KulexiuForTeacher/Common/Base/KSWebLoadRefreshView.xib → KulexiuForTeacher/KulexiuForTeacher/Common/Base/WebView/KSWebLoadRefreshView.xib


+ 38 - 7
KulexiuForTeacher/KulexiuForTeacher/Module/TXClassRoom/View/NewWhiteboard/KSNewWhiteBoard.m

@@ -247,19 +247,50 @@
 {
     dispatch_queue_t queue =  dispatch_queue_create("webViewChallengeQueue", NULL);
     dispatch_async(queue, ^{
-        if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
-            if (challenge.previousFailureCount == 0) {
-                NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
-                completionHandler(NSURLSessionAuthChallengeUseCredential, credential);
-            } else {
-                completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil);
+        if (SSL_AUTH) {
+
+            NSURLSessionAuthChallengeDisposition disposition = NSURLSessionAuthChallengePerformDefaultHandling;
+            NSURLCredential *customCredential = nil;
+            
+            if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
+                // 默认信任
+                customCredential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
+                disposition = NSURLSessionAuthChallengeUseCredential;
+            }
+            else if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodClientCertificate]) {
+                // client authentication
+                SecIdentityRef identity = NULL;
+                SecTrustRef trust = NULL;
+                if ([AuthChallengeManager extractIdentity:&identity andTrust:&trust filePath:CERT_PATH]) {
+                    SecCertificateRef certificate = NULL;
+                    SecIdentityCopyCertificate(identity, &certificate);
+                    const void*certs[] = {certificate};
+                    CFArrayRef certArray =CFArrayCreate(kCFAllocatorDefault, certs,1,NULL);
+                    customCredential =[NSURLCredential credentialWithIdentity:identity certificates:(__bridge  NSArray*)certArray persistence:NSURLCredentialPersistencePermanent];
+                    disposition = NSURLSessionAuthChallengeUseCredential;
+                }
+            }
+            
+            if (completionHandler) {
+                completionHandler(disposition, customCredential);
             }
         }
         else {
-            completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil);
+            if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
+                if (challenge.previousFailureCount == 0) {
+                    NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
+                    completionHandler(NSURLSessionAuthChallengeUseCredential, credential);
+                } else {
+                    completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil);
+                }
+            }
+            else {
+                completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil);
+            }
         }
     });
 }
+
 #pragma mark - WKScriptMessageHandler
 - (void)userContentController:(WKUserContentController *)userContentController
       didReceiveScriptMessage:(WKScriptMessage *)message {