apple 5 年之前
父节点
当前提交
2b68a0930b

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


+ 0 - 6
ios/JianYuIOS/JianYuIOS/AppDelegate.m

@@ -38,12 +38,6 @@
     self.window.rootViewController = tabBarVc;
     [self.window makeKeyAndVisible];
     
-    
-    //URL缓存设置
-    NSURLCache *urlCache = [[NSURLCache alloc]initWithMemoryCapacity:25*1024*1024 diskCapacity:100*1024*1024 diskPath:nil];
-    [NSURLCache setSharedURLCache:urlCache];
- 
-     
     NSString *isProvacy = [[NSUserDefaults standardUserDefaults] objectForKey:@"FirstPrivacy"];
     if ([isProvacy isEqualToString:@"1"]) {
         

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

@@ -389,7 +389,8 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
 #pragma mark - WKNavigationDelegate
 /* 页面加载完成 */
 - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{
-    NSLog(@"-----页面加载完成%@",[self stringByEvaluatingJavaScriptFromString:@"document.location.href"]);
+    NSString *curUrl = [self stringByEvaluatingJavaScriptFromString:@"document.location.href"];
+    NSLog(@"-----页面加载完成%@",curUrl);
 
     if(refreshTabBool){
         NSLog(@"刷新-刷新-刷新-刷新-")
@@ -403,7 +404,7 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
     [[LXViewControllerManager shareViewControllerManager] hideHud];
     
     [self isExitCallToJS:@"afterPageInit()" withMethodName:@"afterPageInit"];
-    
+
 }
 /* 页面开始加载 */
 - (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{

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

@@ -120,6 +120,7 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
 {
     NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/me"];
     url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    
     NSLog(@"444 :第一次加载:%@",url);
     kMainQueue(^{
         [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
@@ -405,7 +406,8 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
 #pragma mark - WKNavigationDelegate
 /* 页面加载完成 */
 - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{
-    NSLog(@"-----页面加载完成%@",[self stringByEvaluatingJavaScriptFromString:@"document.location.href"]);
+    NSString *curUrl = [self stringByEvaluatingJavaScriptFromString:@"document.location.href"];
+    NSLog(@"-----页面加载完成%@",curUrl);
     if(refreshTabBool){
         NSLog(@"刷新-刷新-刷新-刷新-")
         refreshTabBool = NO;

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

@@ -128,7 +128,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
     }
     NSLog(@"111 :第一次加载:%@",url);
     url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
-
+    
     kMainQueue(^{
         [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
     })
@@ -362,7 +362,6 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
 - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
     // 获取完整url并进行UTF-8转码
     NSString *strRequest = [navigationAction.request.URL.absoluteString stringByRemovingPercentEncoding];
-    NSLog(@"监测拦截的url:%@",strRequest);
     if ([strRequest containsString:@"jyapp/article/content"]) {
         NSLog(@"拦截的链接:%@",strRequest);
         if (![strRequest containsString:kHost]) {
@@ -458,17 +457,8 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
     // Do any additional setup after loading the view.
     NSLog(@"首页初始化");
     self.view.backgroundColor = [UIColor whiteColor];
-//    [self initNSURLProtocol];
- /* 取得Library文件夹的位置*/
- NSString *libraryDir = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,NSUserDomainMask, YES)[0];
- /* 取得bundle id,用作文件拼接用*/
- NSString *bundleId  =  [[[NSBundle mainBundle] infoDictionary]objectForKey:@"CFBundleIdentifier"];
- /*
-  * 拼接缓存地址,具体目录为App/Library/Caches/你的APPBundleID/fsCachedData
-  */
- NSString *webKitFolderInCachesfs = [NSString stringWithFormat:@"%@/Caches/%@/fsCachedData",libraryDir,bundleId];
     
-    NSLog(@"webKitfile:%@",webKitFolderInCachesfs)
+    [self initNSURLProtocol];
     
     [self.view addSubview:self.webView];
     [self.view addSubview:self.progressView];
@@ -559,12 +549,11 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
         //正常的网页加载
         [self judgeIsHidden];//是否隐藏
     }
-    
 
     [self removeNoNetViews];
     
     [self isExitCallToJS:@"afterPageInit()" withMethodName:@"afterPageInit"];
-    
+
 }
 /* 页面开始加载 */
 - (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{

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

@@ -395,7 +395,8 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
 #pragma mark - WKNavigationDelegate
 /* 页面加载完成 */
 - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{
-    NSLog(@"-----页面加载完成%@",[self stringByEvaluatingJavaScriptFromString:@"document.location.href"]);
+    NSString *curUrl = [self stringByEvaluatingJavaScriptFromString:@"document.location.href"];
+    NSLog(@"-----页面加载完成%@",curUrl);
 
     if(refreshTabBool){
         NSLog(@"刷新-刷新-刷新-刷新-")
@@ -409,6 +410,7 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
     [[LXViewControllerManager shareViewControllerManager] hideHud];
     
     [self isExitCallToJS:@"afterPageInit()" withMethodName:@"afterPageInit"];
+    
 }
 /* 页面开始加载 */
 - (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{