/* APP从后台转前台调用的方法 */ - (void)applicationDidBecomeActive:(UIApplication *)application { //获取本地保存的token NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; NSString *string = [userDefaults objectForKey:@"login_token"]; if (string != nil) { [self checkUserToken]; } } -(void)checkUserToken { //请求服务器,判断token是否过期 [Common requestWithUrlString:upToken_url contentType:application_json errorShow:YES finished:^(id responseObj) { NSLog(@"%@",responseObj); } failed:^(NSString *errorMsg) { }]; }