瀏覽代碼

备份-https协议模式

apple 5 年之前
父節點
當前提交
c8b19f28ee

二進制
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate


+ 1 - 1
ios/JianYuIOS/JianYuIOS/AppDelegate.m

@@ -37,7 +37,7 @@
     JYTabBarController *tabBarVc = [[JYTabBarController alloc] init];
     self.window.rootViewController = tabBarVc;
     [self.window makeKeyAndVisible];
-    [self initJYBXKey];
+//    [self initJYBXKey]; //注册协议
     
     NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:1000 * 1024 * 1024 diskCapacity:1000 * 1024 * 1024 diskPath:nil];
     [NSURLCache setSharedURLCache:URLCache];

+ 1 - 1
ios/JianYuIOS/JianYuIOS/BaseClass1/PrefixHeader.pch

@@ -175,7 +175,7 @@ _Pragma("clang diagnostic pop")\
 
 //#define kHost @"http://app2-jytest.jianyu360.cn/"  //测试http
 
-#define kHost @"http://app-i2.jianyu360.com/"   //新正式
+#define kHost @"https://app-i2.jianyu360.com/"   //新正式
 
 //#define kHost @"http://app207-jytest.jianyu360.cn/"   //测试http
 

+ 3 - 3
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewExpViewController.m

@@ -137,7 +137,7 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
 {
     NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/jylab/index"];
     url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
-//    NSLog(@"333 :第一次加载:%@",url);
+    NSLog(@"333 :第一次加载:%@",url);
     kMainQueue(^{
         [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
     })
@@ -216,7 +216,7 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
         NSLog(@"不可返回");
         return;
     }
-    [current_url stringByReplacingOccurrencesOfString:@"https://" withString:@"http://"];
+    
     if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/me",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/swordfish/historypush",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/mainSearch",kHost]]){
         return;
     }
@@ -1081,7 +1081,7 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
 -(void)judgeIsHiddenBottom {
     if(self.tabBarController.selectedIndex == 2) {
         NSString *current_url = [self stringByEvaluatingJavaScriptFromString:@"document.location.href"];
-        [current_url stringByReplacingOccurrencesOfString:@"https://" withString:@"http://"];
+        
         if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/index",kHost]]
         ||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/login?back=index",kHost]]){
             [self showTabBar];

+ 3 - 3
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewMineViewController.m

@@ -152,7 +152,7 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
     NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/me"];
     url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
     
-//    NSLog(@"444 :第一次加载:%@",url);
+    NSLog(@"444 :第一次加载:%@",url);
     kMainQueue(^{
         [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
     })
@@ -229,7 +229,7 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
         NSLog(@"不可返回");
         return;
     }
-    [current_url stringByReplacingOccurrencesOfString:@"https://" withString:@"http://"];
+    
     if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/me",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/swordfish/historypush",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/mainSearch",kHost]]){
         return;
     }
@@ -1111,7 +1111,7 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
 -(void)judgeIsHiddenBottom {
     if(self.tabBarController.selectedIndex == 3) {
         NSString *current_url = [self stringByEvaluatingJavaScriptFromString:@"document.location.href"];
-        [current_url stringByReplacingOccurrencesOfString:@"https://" withString:@"http://"];
+        
         if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/me",kHost]]){
             [self showTabBar];
             [self showMethodTabBar];

+ 5 - 10
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewSearchViewController.m

@@ -165,7 +165,6 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
     }
     NSLog(@"111 :第一次加载:%@",tmpUrl);
     tmpUrl =  [tmpUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
-
     kMainQueue(^{
         [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:tmpUrl]]];
     })
@@ -239,7 +238,6 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
         NSLog(@"不可返回");
         return;
     }
-    [current_url stringByReplacingOccurrencesOfString:@"https://" withString:@"http://"];
     if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/me",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/swordfish/historypush",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/mainSearch",kHost]]){
         return;
     }
@@ -421,6 +419,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
 - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
     //如果当前页面是三级页面-
     NSString *curUrl = [webView.URL absoluteString];
+
     if ([curUrl containsString:@"jyapp/article/content"]) {
         //当前页面是三级页面--判断待跳转页面是否符合内置跳转
         NSString *nextUrl = [navigationAction.request.URL absoluteString];
@@ -511,11 +510,13 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
         }];
     });
 }
+
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
     NSLog(@"首页初始化");
-    
+
+
     self.view.backgroundColor = [UIColor whiteColor];
 
     [self.view addSubview:self.webView];
@@ -538,12 +539,8 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
     //监听底部栏
     [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(bottomOneListening) userInfo:nil repeats:YES];
     
-    
     //监听购买结果
     [[SKPaymentQueue defaultQueue] addTransactionObserver:self];
-
-    
-    
 }
 
 
@@ -696,7 +693,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
 #pragma mark - WKNavigationDelegate
 /* 页面加载完成 */
 - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{
-//    NSLog(@"-----页面加载完成%@",webView.URL.absoluteString);
+    NSLog(@"-----页面加载完成%@",webView.URL.absoluteString);
     //第一次加载小红点
     if(!isLoadRedDot) {
         isLoadRedDot = true;
@@ -1453,10 +1450,8 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
 -(void)judgeIsHiddenBottom {
     if(self.tabBarController.selectedIndex == 0) {
         NSString *current_url = [self stringByEvaluatingJavaScriptFromString:@"document.location.href"];
-        NSLog(@"%@",current_url);
         NSArray *array = [current_url componentsSeparatedByString:@"?"];
         current_url = [NSString stringWithFormat:@"%@",array.firstObject];
-        [current_url stringByReplacingOccurrencesOfString:@"https://" withString:@"http://"];
         if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/mainSearch",kHost]]){
             [self showTabBar];
             [self showMethodTabBar];

+ 3 - 3
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewSubViewController.m

@@ -146,7 +146,7 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
 {
     NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/swordfish/historypush"];
     url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
-//    NSLog(@"222 :第一次加载:%@",url);
+    NSLog(@"222 :第一次加载:%@",url);
     kMainQueue(^{
         [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
     })
@@ -221,7 +221,7 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
         NSLog(@"不可返回");
         return;
     }
-    [current_url stringByReplacingOccurrencesOfString:@"https://" withString:@"http://"];
+    
     if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/me",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/swordfish/historypush",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/mainSearch",kHost]]){
         return;
     }
@@ -1102,7 +1102,7 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
 -(void)judgeIsHiddenBottom {
     if(self.tabBarController.selectedIndex == 1) {
         NSString *current_url = [self stringByEvaluatingJavaScriptFromString:@"document.location.href"];
-        [current_url stringByReplacingOccurrencesOfString:@"https://" withString:@"http://"];
+        
         if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/swordfish/historypush",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/login?back=index",kHost]]){
             [self showTabBar];
             [self showMethodTabBar];

+ 5 - 5
ios/JianYuIOS/JianYuIOS/JYWKNewWebController.m

@@ -111,14 +111,14 @@
     self.webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, H, WIDTH, HEIGHT-STATUS_BAR_HEIGHT-H) configuration:config];
     if (iPhoneX) {
         if (@available(iOS 11.0, *)) {
-            _webView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
+            self.webView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
         }
     }
     self.webView.scrollView.bounces = NO;
     self.webView.navigationDelegate = self;
-    self.webView.userInteractionEnabled = YES;
     [self.view addSubview:self.webView];
     [self.webView addObserver:self forKeyPath:@"estimatedProgress" options:NSKeyValueObservingOptionNew context:nil];
+    NSLog(@"外部链接:%@",self.url);
     [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.url]]];
     [self.view addSubview:backBtn_1];
     [self.view addSubview:titleView];
@@ -232,9 +232,9 @@
 
 
 
--(void)dealloc {
-    NSLog(@"释放");
-}
+//-(void)dealloc {
+//    NSLog(@"释放");
+//}