From 8c3f24eac11caae968468da2e50db041b6725113 Mon Sep 17 00:00:00 2001 From: zhangjian <zhangjianrock@163.com> Date: 星期五, 04 八月 2023 14:44:15 +0800 Subject: [PATCH] 修改参数 --- /dev/null | 27 --------------------------- ard-work/src/main/java/com/ruoyi/device/uav/controller/ArdUavController.java | 4 +++- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/ard-work/src/main/java/com/ruoyi/device/uav/controller/ArdUavController.java b/ard-work/src/main/java/com/ruoyi/device/uav/controller/ArdUavController.java index 07d1185..076f54f 100644 --- a/ard-work/src/main/java/com/ruoyi/device/uav/controller/ArdUavController.java +++ b/ard-work/src/main/java/com/ruoyi/device/uav/controller/ArdUavController.java @@ -58,7 +58,9 @@ @PostMapping("/") @ApiOperation("鏃犱汉鏈簆ost鎺ュ彛") - public Object post(@RequestParam String url, @RequestParam String data) { + public Object post(@RequestBody Map<String,String> param) { + String url = param.get("url"); + String data = param.get("data"); return this.uavService.doUavRequest(POST, url, data); } diff --git a/ard-work/src/main/java/com/ruoyi/utils/forest/UavAuth.java b/ard-work/src/main/java/com/ruoyi/utils/forest/UavAuth.java deleted file mode 100644 index 78a93f0..0000000 --- a/ard-work/src/main/java/com/ruoyi/utils/forest/UavAuth.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.ruoyi.utils.forest; - - -import com.dtflys.forest.annotation.MethodLifeCycle; -import com.dtflys.forest.annotation.RequestAttributes; - -import java.lang.annotation.*; - -@MethodLifeCycle(UavAuthLifeCircle.class) -@Documented -/** 閲嶇偣锛� @MethodLifeCycle娉ㄨВ鎸囧畾璇ユ敞瑙g殑鐢熷懡鍛ㄦ湡绫�*/ -@RequestAttributes -@Retention(RetentionPolicy.RUNTIME) -/** 鎸囧畾璇ユ敞瑙e彲鐢ㄤ簬绫讳笂鎴栨柟娉曚笂 */ -@Target({ElementType.TYPE, ElementType.METHOD}) -public @interface UavAuth { - String token(); -} diff --git a/ard-work/src/main/java/com/ruoyi/utils/forest/UavAuthLifeCircle.java b/ard-work/src/main/java/com/ruoyi/utils/forest/UavAuthLifeCircle.java deleted file mode 100644 index db6338f..0000000 --- a/ard-work/src/main/java/com/ruoyi/utils/forest/UavAuthLifeCircle.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.ruoyi.utils.forest; - -import com.dtflys.forest.http.ForestRequest; -import com.dtflys.forest.lifecycles.MethodAnnotationLifeCycle; -import com.dtflys.forest.reflection.ForestMethod; - -public class UavAuthLifeCircle implements MethodAnnotationLifeCycle<UavAuth, Object> { - - - /** - * 鍙戦�佽姹傚墠鎵ц姝ゆ柟娉� - */ - @Override - public boolean beforeExecute(ForestRequest request) { - String token = (String) getAttribute(request, "token"); - request.addHeader("x-auth-token", token); - return true; - } - - /** - * 姝ゆ柟娉曞湪璇锋眰鏂规硶鍒濆鍖栫殑鏃跺�欒璋冪敤 - */ - - @Override - public void onMethodInitialized(ForestMethod forestMethod, UavAuth uavAuth) { - } -} -- Gitblit v1.9.3