|
@@ -67,6 +67,7 @@ JSExportAs(redirectKeyset, -(void)jsRedirectKeyset:(NSString*)str);
|
|
|
NSInteger _timeTick;
|
|
|
NSInteger _time;
|
|
|
|
|
|
+ BOOL autologin;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -138,6 +139,15 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
|
|
|
self.timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(timeFireMethod) userInfo:nil repeats:YES];
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ //新增刷新通知
|
|
|
+
|
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshSS:) name:@"refreshSS" object:nil];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
-(void)timeFireMethod{
|
|
|
_timeTick++;
|
|
@@ -190,8 +200,18 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
NSString *current_url = [self.webView stringByEvaluatingJavaScriptFromString:@"document.location.href"];
|
|
|
NSLog(@"当前页面:%@",current_url);
|
|
|
+
|
|
|
+
|
|
|
+ if([current_url containsString:@"jyapp/free/login"]) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
// NSString *current_url = self.webView.request.URL.absoluteString;
|
|
|
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/wxkeyset/keyset/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/mainSearch",kHost]]){
|
|
|
return;
|
|
@@ -544,6 +564,19 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
NSString *url = webView.request.URL.absoluteString;
|
|
|
[self doSomeWithLoadUrl:url];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //加载第一次成功的时候 调JS
|
|
|
+ if(!autologin&&[LXUserDefaults token]) {
|
|
|
+ autologin = YES;
|
|
|
+ NSString *textJS = [NSString stringWithFormat:@"refAutoLogin('%@')",@"S"];
|
|
|
+ JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
|
|
|
+ [context evaluateScript:textJS];
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//15737190152
|
|
@@ -1000,6 +1033,13 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
|
|
|
[self webViewFirstRequest];
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+//通知刷新页面
|
|
|
+-(void)refreshSS:(NSNotification *)notificaition{
|
|
|
+ [self webViewFirstRequest];
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
/*
|
|
|
#pragma mark - Navigation
|
|
|
|