时间:2020-11-24 16:20:29 | 栏目:iOS代码 | 点击:次
// 1. 取出需要同步的url (登录请求中返回的重定向地址) BESTHttpItem *httpItem = [BESTHttpHelper sharedHelper].curHttpItem; NSString *url = [NSString stringWithFormat:@"%@/#/login", httpItem.frontend_addr]; // 2. 取出当前的headerFields NSDictionary *headerFields = [NSHTTPCookie requestHeaderFieldsWithCookies:self.cookies]; // 3. 替换cookie地址 [NSHTTPCookie cookiesWithResponseHeaderFields:headerFields forURL:[NSURL URLWithString:url]];