Browse Source

fix:个人库上传调整

liaoyitao 1 month ago
parent
commit
b3457e7f35

+ 1 - 1
src/main/java/com/lqkj/link/module/zone/controller/ResourceController.java

@@ -275,7 +275,7 @@ public class ResourceController {
275 275
         String authHeader = request.getHeader("Authorization");
276 276
         String userCode = jwtService.decryptUsernameWithHeader(authHeader);
277 277
         Integer userId = userInfoService.detailByUserCode(userCode).getUserId();
278
-        return MessageBean.ok(baseService.ossAddModel(file, "resource/model/" + request.getLocalAddr() + "/" +  request.getLocalPort() + request.getContextPath() + "/" +  userId + "/"), "oss上传");
278
+        return MessageBean.ok(baseService.ossAddModel(file, "resource/model/" + request.getRemoteHost()+ "/" +  request.getLocalPort() + request.getContextPath() + "/" +  userId + "/"), "oss上传");
279 279
     }
280 280
 
281 281
 

+ 1 - 1
src/main/java/com/lqkj/link/module/zone/service/ResourceService.java

@@ -199,7 +199,7 @@ public class ResourceService {
199 199
      */
200 200
     public String ossCheckCapacity(String userCode, HttpServletRequest request) {
201 201
         UserInfo userInfo = userInfoRepository.findByUserCode(userCode);
202
-        Long aLong = aliOSSUtils.ossCheckCapacity("resource/model/" + request.getLocalAddr() + "/" +  request.getLocalPort() + request.getContextPath() + "/" +  userInfo.getUserId() + "/");
202
+        Long aLong = aliOSSUtils.ossCheckCapacity("resource/model/" + request.getRemoteHost() + "/" +  request.getLocalPort() + request.getContextPath() + "/" +  userInfo.getUserId() + "/");
203 203
         return "个人库 已使用" + FileUtils.convertBytes(aLong) + "/20G";
204 204
     }
205 205
 }