解决token 401问题

This commit is contained in:
huangzhuanghua
2016-11-16 14:22:07 +08:00
parent d74d91532b
commit b9eb8de88a
6 changed files with 131 additions and 99 deletions

View File

@ -275,14 +275,18 @@ public class FileUtils {
int statusCode = connection.getResponseCode();
Utils.log("statusCode = " + statusCode);
if (statusCode == HttpURLConnection.HTTP_OK) {
if (statusCode == 200) {
// {"icon":"http:\/\/gh-test-1.oss-cn-qingdao.aliyuncs.com\/pic\/57e4f4d58a3200042d29492f.jpg"}
JSONObject response = new JSONObject(b.toString().trim());
response.put("statusCode", HttpURLConnection.HTTP_OK);
response.put("statusCode", 200);
return response;
} else if (statusCode == HttpURLConnection.HTTP_FORBIDDEN) {
} else if (statusCode == 403) {
JSONObject response = new JSONObject(b.toString().trim());
response.put("statusCode", HttpURLConnection.HTTP_FORBIDDEN);
response.put("statusCode", 403);
return response;
} else if (statusCode == 401) {
JSONObject response = new JSONObject();
response.put("statusCode", 401);
return response;
}
} catch (Exception e) {