From 426ca8ebba54d51f2df77e9251893ea069597518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=85=95=E4=B8=8B?= <484014559@qq.com> Date: Mon, 9 Sep 2024 17:05:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=BA=E8=83=BD=E8=A1=A8=E5=8D=95=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../security/config/YudaoWebSecurityConfigurerAdapter.java | 2 +- .../controller/admin/dynamic/DynamicDataController.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java index 90822de..3b9f500 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java @@ -128,7 +128,7 @@ public class YudaoWebSecurityConfigurerAdapter { // ①:全局共享规则 .authorizeRequests() // 1.1 静态资源,可匿名访问 - .antMatchers(HttpMethod.GET, "/*.html", "/**/*.html", "/**/*.css", "/**/*.js").permitAll() + .antMatchers(HttpMethod.GET, "/*.html", "/**/*.html", "/**/*.css", "/**/*.js","/intelligentForm/selectDynamicDataById","/intelligentForm/selectDynamicDataById").permitAll() // 1.2 设置 @PermitAll 无需认证 .antMatchers(HttpMethod.GET, permitAllUrls.get(HttpMethod.GET).toArray(new String[0])).permitAll() .antMatchers(HttpMethod.POST, permitAllUrls.get(HttpMethod.POST).toArray(new String[0])).permitAll() diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/dynamic/DynamicDataController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/dynamic/DynamicDataController.java index 8897777..4862da9 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/dynamic/DynamicDataController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/dynamic/DynamicDataController.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.promotion.controller.admin.dynamic; import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; import cn.iocoder.yudao.module.promotion.dal.dataobject.dynamic.DynamicData; import cn.iocoder.yudao.module.promotion.dal.dataobject.dynamic.DynamicForm; import cn.iocoder.yudao.module.promotion.service.dynamic.DynamicDataService; @@ -9,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.web.bind.annotation.*; +import javax.annotation.security.PermitAll; import javax.servlet.http.HttpServletRequest; import java.util.ArrayList; import java.util.List; @@ -45,12 +47,14 @@ public class DynamicDataController { } //根据id查询数据 @GetMapping("/selectDynamicDataById") + @PermitAll public CommonResult selectDynamicDataById(String id){ return success(dynamicDataService.doSelectDynamicDataById(id)); } //采集数据 @PostMapping("/collectData") + @PermitAll public CommonResult collectData(@RequestBody DynamicForm dynamicForm){ dynamicFormService.doCollectData(dynamicForm); return success("保存成功");