lyhzzz 1 år sedan
förälder
incheckning
e8bd20e7ea

+ 6 - 5
src/main/java/com/fdkankan/manage_jp/controller/ProjectSceneController.java

@@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.net.URL;
+import java.net.URLDecoder;
 import java.net.URLEncoder;
 
 /**
@@ -51,18 +52,18 @@ public class ProjectSceneController extends BaseController{
         param.setCompanyId(getUser().getCompanyId());
         String jsonString = JSONObject.toJSONString(param);
         String ciphertext = RsaUtils.encipher(jsonString, RsaUtils.publicKey);
-        return Result.success("/service/manage_jp/projectScene/getSceneMap?ciphertext="+ ciphertext);
+        return Result.success("/service/manage_jp/projectScene/getSceneMap/"+ URLEncoder.encode(ciphertext)+"/1");
     }
 
-    @GetMapping("/getSceneMap")
-    public Result getSceneMap(@RequestParam(required = false) String ciphertext,
-                              @RequestParam(required = false,defaultValue = "1") Integer type){
+    @GetMapping("/getSceneMap/{ciphertext}/{type}")
+    public Result getSceneMap(@PathVariable String ciphertext,
+                              @PathVariable Integer type){
         if (StringUtils.isBlank(ciphertext)){
             throw new BusinessException(ResultCode.PARAM_ERROR);
         }
+        ciphertext = URLDecoder.decode(ciphertext);
         log.info("ciphertext:{},type:{}",ciphertext,type);
         String deTxt = RsaUtils.decipher(ciphertext, RsaUtils.privateKey);
-        log.info("deTxt:{}",deTxt);
         SceneGpsParam param = JSONObject.parseObject(deTxt, SceneGpsParam.class);
         param.setType(type);
         return Result.success(projectSceneGpsService.allSceneGps(param));