/* 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) { }]; }
原文地址:https://www.cnblogs.com/sayimba/p/8328846.html
时间: 2024-10-02 23:39:14