|
@@ -124,7 +124,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
{
|
|
|
NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/index"];
|
|
|
NSString *token = [LXUserDefaults token];
|
|
|
- if (token) {
|
|
|
+ if ([LXUserDefaults isExistToken]) {
|
|
|
url = [url stringByAppendingString:[NSString stringWithFormat:@"?sign=%@&url=/jyapp/jylab/mainSearch&from=restart", token]];
|
|
|
}
|
|
|
NSLog(@"111 :第一次加载:%@",url);
|
|
@@ -176,6 +176,10 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadWebView) name:kReloadWebVIew object:nil];
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginOut:) name:kLoginOut object:nil];
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(netReachChanged:) name:AFNetworkingReachabilityDidChangeNotification object:nil];
|
|
|
+
|
|
|
+ //前往登录通知-tabbar
|
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(isLoginTabBar:) name:LoginIndexTabBar object:nil];
|
|
|
+
|
|
|
//展示底部红的通知
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(newsRedPoint:) name:JYNewsRedPoint object:nil];
|
|
|
//接收全新通知
|
|
@@ -406,14 +410,16 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
#pragma mark - OC调JS交互
|
|
|
-(void)isExitCallToJS:(NSString *)jsStr withMethodName:(NSString *)name{
|
|
|
NSString *jsName = [NSString stringWithFormat:@"function exist(){return !window['%@']};exist()",name];
|
|
|
- [_webView evaluateJavaScript:jsName completionHandler:^(id _Nullable result, NSError * _Nullable error) {
|
|
|
- NSLog(@"是否存在 result:%@,error:%@",result,error);
|
|
|
- if ([result intValue]==0) {
|
|
|
- [self executeCallJS:jsStr];
|
|
|
- }else {
|
|
|
- NSLog(@"不存在-不存在-不存在-%@",jsStr);
|
|
|
- }
|
|
|
- }];
|
|
|
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.15 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
+ [_webView evaluateJavaScript:jsName completionHandler:^(id _Nullable result, NSError * _Nullable error) {
|
|
|
+ NSLog(@"是否存在 result:%@,error:%@",result,error);
|
|
|
+ if ([result intValue]==0) {
|
|
|
+ [self executeCallJS:jsStr];
|
|
|
+ }else {
|
|
|
+ NSLog(@"不存在-不存在-不存在-%@",jsStr);
|
|
|
+ }
|
|
|
+ }];
|
|
|
+ });
|
|
|
}
|
|
|
-(void)executeCallJS:(NSString *)jsStr {
|
|
|
|
|
@@ -454,8 +460,8 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
-(void)initApnsTimer {
|
|
|
//定时器
|
|
|
- if([LXUserDefaults token]) {
|
|
|
- self.notiDict = [[NSMutableDictionary alloc]initWithDictionary:[[NSUserDefaults standardUserDefaults] objectForKey:@"NotiDict"]];
|
|
|
+ if([LXUserDefaults isExistToken]) {
|
|
|
+ self.notiDict = [[NSMutableDictionary alloc]initWithDictionary:[[NSUserDefaults standardUserDefaults] objectForKey:RemoteNotifications]];
|
|
|
if(self.notiDict.count) {
|
|
|
self.timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(timeFireMethod) userInfo:nil repeats:YES];
|
|
|
}
|
|
@@ -465,7 +471,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
{
|
|
|
NSLog(@"http请求-------小红点");
|
|
|
NSString *token = [LXUserDefaults token];
|
|
|
- if (token) {
|
|
|
+ if ([LXUserDefaults isExistToken]) {
|
|
|
[[LXNetworkManager shareLXNetworkManager]postWithURLStr:[NSString stringWithFormat:@"%@jyapp/free/showRedSpotOnMenu",kHost] parameters:@{@"token":token} progress:^(NSProgress *progress) {
|
|
|
NSLog(@"%@",progress);
|
|
|
} success:^(id responseObject) {
|
|
@@ -695,7 +701,8 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
return [LXUserDefaults isInstallWeiXin];
|
|
|
}
|
|
|
-(NSString *)jsGetCipherText:(NSDictionary *)dict{
|
|
|
- NSString *phone = [NSString stringWithFormat:@"%@",dict[@"phone"]];
|
|
|
+ NSDictionary *objDict = [NSDictionary dictionaryWithDictionary:dict[@"arguments"]];
|
|
|
+ NSString *phone = [NSString stringWithFormat:@"%@",objDict[@"phone"]];
|
|
|
NSDate *date=[NSDate date];
|
|
|
NSDateFormatter *format1=[[NSDateFormatter alloc] init];
|
|
|
[format1 setDateFormat:@"yyyyMMddhhmmss"];
|
|
@@ -970,7 +977,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
[self.timer invalidate];
|
|
|
self.timer = nil;
|
|
|
_timeTick = 0;
|
|
|
- [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"NotiDict"];
|
|
|
+ [[NSUserDefaults standardUserDefaults] removeObjectForKey:RemoteNotifications];
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
@@ -979,7 +986,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
[self.timer invalidate];
|
|
|
self.timer = nil;
|
|
|
_timeTick = 0;
|
|
|
- [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"NotiDict"];
|
|
|
+ [[NSUserDefaults standardUserDefaults] removeObjectForKey:RemoteNotifications];
|
|
|
}
|
|
|
}
|
|
|
-(void)pushDY:(NSDictionary *)infoDict
|