Commit 70696ba66c703c8b35f78908c2931c529cf84e33
1 parent
387d1c80
装修垃圾登录优化
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); | ... | ... |