lyhzzz vor 5 Monaten
Ursprung
Commit
a70a907583

+ 6 - 0
src/main/java/com/fdkankan/ucenter/UserCenterApplication.java

@@ -28,6 +28,10 @@ public class UserCenterApplication implements CommandLineRunner {
     private String mainUrl;
     @Value("${spring.profiles.active}")
     private String activeFile;
+    @Value("${fyun.host}")
+    private String host;
+    @Value("${fyun.endPoint}")
+    private String endPoint;
 
     public static void main(String[] args) {
         SpringApplication.run(UserCenterApplication.class, args);
@@ -35,6 +39,8 @@ public class UserCenterApplication implements CommandLineRunner {
 
     @Override
     public void run(String... args) throws Exception {
+        NacosProperty.host = host;
+        NacosProperty.endPoint = endPoint;
         NacosProperty.bucket = bucket;
         NacosProperty.uploadType = uploadType;
         NacosProperty.activeFile = activeFile;

+ 2 - 0
src/main/java/com/fdkankan/ucenter/common/constants/NacosProperty.java

@@ -8,6 +8,8 @@ import java.net.UnknownHostException;
 public class NacosProperty {
 
     public static String bucket;
+    public static String host;
+    public static String endPoint;
     public static String uploadType;
     public static String activeFile;
     private static String mainUrl;

+ 4 - 2
src/main/java/com/fdkankan/ucenter/controller/SceneController.java

@@ -9,6 +9,7 @@ import com.fdkankan.ucenter.common.BaseController;
 import com.fdkankan.ucenter.common.DownloadStatusEnum;
 import com.fdkankan.ucenter.common.Result;
 import com.fdkankan.ucenter.common.constants.ConstantFilePath;
+import com.fdkankan.ucenter.common.constants.NacosProperty;
 import com.fdkankan.ucenter.common.constants.ResultCode;
 import com.fdkankan.ucenter.common.constants.ResultCodeMsg;
 import com.fdkankan.ucenter.entity.ScenePlus;
@@ -25,6 +26,7 @@ import com.fdkankan.ucenter.vo.response.DownloadProcessVo;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.language.Nysiis;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -314,11 +316,11 @@ public class SceneController extends BaseController {
         URL presignedUrl = fYunFileServiceInterface.getPresignedUrl("ucenter/e57/" + newFileName + suffix);
         HashMap<String, Object> map = new HashMap<>();
         map.put("newFileName",newFileName + suffix);
-        map.put("url",presignedUrl);
+        map.put("url",presignedUrl.toString().replace(NacosProperty.endPoint+"/",NacosProperty.host));
         return Result.success(map);
     }
 
-    @PostMapping("relevanceE57")
+    @PostMapping("/relevanceE57")
     public Result relevanceE57( @RequestParam(value = "isObj",required = false)Integer isObj,
                                 @RequestParam(value = "title",required = false)String title,
                                 @RequestParam(value = "newFileName",required = false)String newFileName ){