瀏覽代碼

修改token相关条件

apple 5 年之前
父節點
當前提交
2a57e196e6

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


+ 98 - 0
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -3,4 +3,102 @@
    uuid = "3209AFD3-A9DA-4750-983A-195A695CA827"
    type = "0"
    version = "2.0">
+   <Breakpoints>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "EC121EE5-0EC6-43CD-954B-9CA47392453C"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "JianYuIOS/Classes&#xff08;&#x6a21;&#x5757;&#xff09;/JYSearchViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "1195"
+            endingLineNumber = "1195"
+            landmarkName = "-jsGGetCipherText:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "E7223447-4906-4747-8B44-1BA95DC6A5E0"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "JianYuIOS/Classes&#xff08;&#x6a21;&#x5757;&#xff09;/JYNewSearchViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "705"
+            endingLineNumber = "705"
+            landmarkName = "-jsGetCipherText:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "8DF5A884-25A7-429F-AC3F-C06193C074FB"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "JianYuIOS/Classes&#xff08;&#x6a21;&#x5757;&#xff09;/JYNewSearchViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "704"
+            endingLineNumber = "704"
+            landmarkName = "-jsGetCipherText:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "BB47EB0C-5765-412D-BAE5-C01F74016180"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "JianYuIOS/Classes&#xff08;&#x6a21;&#x5757;&#xff09;/JYNewSearchViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "29"
+            endingLineNumber = "29"
+            landmarkName = "notiDict"
+            landmarkType = "24">
+            <Locations>
+               <Location
+                  uuid = "BB47EB0C-5765-412D-BAE5-C01F74016180 - d20c21ce5ef5f34f"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "-[JYNewSearchViewController notiDict]"
+                  moduleName = "&#x5251;&#x9c7c;&#x6807;&#x8baf;"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/apple/Desktop/jyiosapp/ios/JianYuIOS/JianYuIOS/Classes%EF%BC%88%E6%A8%A1%E5%9D%97%EF%BC%89/JYNewSearchViewController.m"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "29"
+                  endingLineNumber = "29"
+                  offsetFromSymbolStart = "20">
+               </Location>
+               <Location
+                  uuid = "BB47EB0C-5765-412D-BAE5-C01F74016180 - 6d63b0a8f2444871"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "-[JYNewSearchViewController setNotiDict:]"
+                  moduleName = "&#x5251;&#x9c7c;&#x6807;&#x8baf;"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/apple/Desktop/jyiosapp/ios/JianYuIOS/JianYuIOS/Classes%EF%BC%88%E6%A8%A1%E5%9D%97%EF%BC%89/JYNewSearchViewController.m"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "29"
+                  endingLineNumber = "29"
+                  offsetFromSymbolStart = "60">
+               </Location>
+            </Locations>
+         </BreakpointContent>
+      </BreakpointProxy>
+   </Breakpoints>
 </Bucket>

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

@@ -339,7 +339,7 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{
 
             if(self.wakeUpBool) {
                 //刚启动
-                [[NSUserDefaults standardUserDefaults]setObject:userInfo forKey:@"NotiDict"];
+                [[NSUserDefaults standardUserDefaults]setObject:userInfo forKey:RemoteNotifications];
                 self.wakeUpBool = NO;
             }
             
@@ -457,7 +457,7 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{
     NSString *content = [userInfo valueForKey:@"content"];
     //    NSDictionary *extras = [userInfo valueForKey:@"extras"];
     //    NSString *customizeField1 = [extras valueForKey:@"customizeField1"]; //服务端传递的Extras附加字段,key是自己定
-    if ([LXUserDefaults token] && userInfo[@"content_type"] && [userInfo[@"content_type"] isEqualToString:@"signOut"]) {
+    if ([LXUserDefaults isExistToken] && userInfo[@"content_type"] && [userInfo[@"content_type"] isEqualToString:@"signOut"]) {
         
         
         AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];

+ 3 - 0
ios/JianYuIOS/JianYuIOS/BaseClass1/LXUserDefaults.h

@@ -35,4 +35,7 @@
 
 // 清空
 +(void)clearAll;
+// 清空
++(BOOL)isExistToken;
+
 @end

+ 11 - 0
ios/JianYuIOS/JianYuIOS/BaseClass1/LXUserDefaults.m

@@ -95,4 +95,15 @@
     [userDef removeObjectForKey:@"token"];
     [userDef removeObjectForKey:@"openID"];
 }
+
+
+
+
++(BOOL)isExistToken{
+    if ([[self token] isEqualToString:@""]) {
+        return NO;
+    }
+    return YES;
+}
+
 @end

+ 3 - 0
ios/JianYuIOS/JianYuIOS/BaseClass1/PrefixHeader.pch

@@ -117,6 +117,9 @@ _Pragma("clang diagnostic pop")\
 //只刷新我的和百宝箱
 #define RefreshExpAndMine @"RefreshExpAndMine"
 
+//通知-后台唤起-
+#define RemoteNotifications @"RemoteNotifications"
+
 //渐变色
 #define ColorGradientArray [NSArray arrayWithObjects:(id)UIColorFromRGB(0x094303).CGColor,(id)UIColorFromRGB(0x343d32).CGColor,(id)UIColorFromRGB(0xB2B7B7).CGColor, nil]
 

+ 2 - 6
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYMineViewController.m

@@ -316,10 +316,6 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
 // 首次加载web
 -(void)webViewFirstRequest{
     NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/me"];
-    //    NSString *token = [LXUserDefaults token];
-    //    if (token) {
-    //        url = [url stringByAppendingString:[NSString stringWithFormat:@"?sign=%@&url=/jyapp/jylab/mainSearch&from=restart", token]];
-    //    }
     NSLog(@"444第一次加载%@",url);
     url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
     
@@ -366,7 +362,7 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
 // 点击通知 跳转到通知内url
 -(void)requestWebView:(NSNotification *)notification{
     
-    if(![LXUserDefaults token]) {
+    if(![LXUserDefaults isExistToken]) {
         return;
     }
     
@@ -392,7 +388,7 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
 
 
 -(void)clickSubNotiMethods:(NSNotification *)notification{
-    if(![LXUserDefaults token]) {
+    if(![LXUserDefaults isExistToken]) {
         return;
     }
     NSDictionary * infoDict = [notification object][@"info"];

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

@@ -565,7 +565,8 @@ NSString *const new_AesKey_3 = @"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"];

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

@@ -297,6 +297,7 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
     NSError *err = nil;
     NSData *dataFromString = [prompt dataUsingEncoding:NSUTF8StringEncoding];
     NSDictionary *paramdict = [NSJSONSerialization JSONObjectWithData:dataFromString options:NSJSONReadingMutableContainers error:&err];
+    NSLog(@"拦截%@",paramdict);
     if (!err){
         NSString *type = [paramdict objectForKey:@"jsName"];
         if (type && [type isEqualToString:@"getUserToken"]) {
@@ -375,6 +376,7 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
         }
     }];
 }
+
 -(void)executeCallJS:(NSString *)jsStr {
      NSLog(@"OC调JS交互%@:",jsStr);
     [_webView evaluateJavaScript:jsStr completionHandler:^(id _Nullable result, NSError * _Nullable error) {
@@ -405,7 +407,6 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
 /* 页面加载完成 */
 - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{
     NSLog(@"-----页面加载完成%@",[self stringByEvaluatingJavaScriptFromString:@"document.location.href"]);
-
     if(refreshTabBool){
         NSLog(@"刷新-刷新-刷新-刷新-")
         refreshTabBool = NO;
@@ -580,14 +581,14 @@ NSString *const new_AesKey_4 = @"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"];
     NSString *dateStr;
     dateStr=[format1 stringFromDate:date];
-    NSLog(@"%@",dateStr);
-    
+
     NSString *content = [[NSString stringWithFormat:@"%@_%@",phone,dateStr] stringByAppendingString:[NSString stringWithFormat:@"_%@",[LXMD5 md532BitLower:[NSString stringWithFormat:@"%@&%@",phone,dateStr]]]];
     NSData *contentData = [content dataUsingEncoding:NSUTF8StringEncoding];
     NSUInteger dataLength = contentData.length;
@@ -1077,7 +1078,7 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
 }
 
 -(void)clickSubNotiMethods:(NSNotification *)notification{
-    if(![LXUserDefaults token]) {
+    if(![LXUserDefaults isExistToken]) {
         return;
     }
     NSDictionary * infoDict = [notification object][@"info"];

+ 22 - 15
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewSearchViewController.m

@@ -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

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

@@ -573,7 +573,8 @@ NSString *const new_AesKey_2 = @"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"];

+ 6 - 8
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYSearchViewController.m

@@ -200,8 +200,8 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
     
     //新增监听
     
-    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];
         }
@@ -261,7 +261,7 @@ NSString *const AesKey_0 = @"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) {
@@ -325,7 +325,7 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
             [self.timer invalidate];
             self.timer = nil;
             _timeTick = 0;
-            [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"NotiDict"];
+            [[NSUserDefaults standardUserDefaults] removeObjectForKey:RemoteNotifications];
             
         }
         return;
@@ -335,7 +335,7 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
         [self.timer invalidate];
         self.timer = nil;
         _timeTick = 0;
-        [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"NotiDict"];
+        [[NSUserDefaults standardUserDefaults] removeObjectForKey:RemoteNotifications];
     }
 }
 
@@ -441,12 +441,10 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
 -(void)webViewFirstRequest{
     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);
-//    url = @"https://www.baidu.com";
-//    url = @"http://www.ccgp-shandong.gov.cn/sdgp2017/upload/attach/20200514170407_2000174003.doc";
     url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
 
     kMainQueue(^{

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

@@ -83,7 +83,7 @@
 //    if(tabBarController.tabBar.selectedItem.tag==0) {
 //        return NO;
 //    }
-    if (![LXUserDefaults token]) {
+    if (![LXUserDefaults isExistToken]) {
         
         if(tabBarController.tabBar.selectedItem.tag!=0) {
             NSLog(@"没有token前往登录");

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

@@ -237,7 +237,7 @@ NSString *const AesKey = @"mGlAgnIBB8bx2nch";
 -(void)webViewFirstRequest{
     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]];
     }
     url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];