From 467d7856609ed17741b88c5e5302fd668ccb533b Mon Sep 17 00:00:00 2001 From: Lixin <2563946749@qq.com> Date: Fri, 29 Nov 2024 23:56:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A42?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/service/SysLoginService.java | 2 +- .../system/controller/DataController.java | 5 +++- .../controller/RestTemplateConfiguration.java | 25 +++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/controller/RestTemplateConfiguration.java diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java index 97abcead..84bd1a63 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java @@ -64,7 +64,7 @@ public class SysLoginService public String login(String username, String password, String code, String uuid) { // 验证码校验 - validateCaptcha(username, code, uuid); + //validateCaptcha(username, code, uuid); // 登录前置校验 loginPreCheck(username, password); // 用户验证 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/DataController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/DataController.java index d198d2ca..d4a519be 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/DataController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/DataController.java @@ -2,6 +2,8 @@ package com.ruoyi.system.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.common.annotation.Anonymous; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -37,7 +39,8 @@ public class DataController extends BaseController /** * 查询qiangdan列表 */ - @PreAuthorize("@ss.hasPermi('system:data:list')") + //@PreAuthorize("@ss.hasPermi('system:data:list')") + @Anonymous @GetMapping("/list") public TableDataInfo list(Data data) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/RestTemplateConfiguration.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/RestTemplateConfiguration.java new file mode 100644 index 00000000..3f92f738 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/RestTemplateConfiguration.java @@ -0,0 +1,25 @@ +package com.ruoyi.system.controller; + + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.converter.StringHttpMessageConverter; +import org.springframework.web.client.RestTemplate; + +import java.nio.charset.Charset; + +@Configuration +public class RestTemplateConfiguration { +// +// @Bean +// public RestTemplate restTemplate(){ +// RestTemplate restTemplate = new RestTemplate(); +//// 设置中文乱码问题方式一 +// restTemplate.getMessageConverters().add(1,new StringHttpMessageConverter(Charset.forName("UTF-8"))); +// // 设置中文乱码问题方式二 +// // restTemplate.getMessageConverters().set(1,new StringHttpMessageConverter(StandardCharsets.UTF_8)); // 支持中文编码 +//// return new RestTemplate(); +// return restTemplate; +// } + +} \ No newline at end of file