解决token 401问题
This commit is contained in:
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user