Browse Source

获取web访问令牌

buzhanyi 2 years ago
parent
commit
49deb47251

+ 3 - 3
hazard-sdk/src/main/java/com/ozs/controller/upload/GeoHazardMonitorTokenController.java

@@ -25,6 +25,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.ObjectUtils;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -65,10 +66,9 @@ public class GeoHazardMonitorTokenController {
      * @return
      */
     @PostMapping("/IPAddress/token")
-    public String getWebToken(@RequestParam("parameter") String parameter) {
+    public String getWebToken(@RequestBody SvcAddress svcAddress) {
         // 生成令牌
-        JSONObject jsonObject=new JSONObject();
-        SvcAddress svcAddress = JSON.parseObject(parameter, SvcAddress.class);
+        JSONObject jsonObject = new JSONObject();
         LambdaQueryWrapper<SvcAddress> lw = new LambdaQueryWrapper<SvcAddress>();
         if (!ObjectUtils.isEmpty(svcAddress.getGrantType())) {
             lw.eq(SvcAddress::getGrantType, svcAddress.getGrantType());