Commit 4a78f2a87f85c9d785b69b4ae725afe12d562677
Merge branch 'dev' of http://61.169.120.202:8888/youxiw20000/trash into dev
Showing
1 changed file
with
6 additions
and
1 deletions
trash-garbage/src/main/java/com/trash/garbage/utils/HttpUtil.java
| ... | ... | @@ -27,7 +27,12 @@ public class HttpUtil { |
| 27 | 27 | |
| 28 | 28 | String json = null; |
| 29 | 29 | |
| 30 | - HttpRequest request = HttpRequest.post(trashConfig.remotePath + url).header("Authorization", trashConfig.authorization).header("Content-Type", trashConfig.contentType) | |
| 30 | + String token = trashConfig.authorization; | |
| 31 | + if(!token.contains("Bearer")){ | |
| 32 | + token = "Bearer " + token; | |
| 33 | + } | |
| 34 | + | |
| 35 | + HttpRequest request = HttpRequest.post(trashConfig.remotePath + url).header("Authorization", token).header("Content-Type", trashConfig.contentType) | |
| 31 | 36 | .timeout(15000); |
| 32 | 37 | if (StringUtils.isNotEmpty(body)) { |
| 33 | 38 | request.body(body); | ... | ... |