问题处理

master
cheney 8 months ago
parent a0353a8567
commit 7ffa1b4e1f
  1. 2
      src/main/java/com/huoran/iasf/common/config/WebMvcConfigurer.java
  2. 12
      src/main/java/com/huoran/iasf/controller/SysContentController.java
  3. 11
      src/main/java/com/huoran/iasf/controller/UserController.java
  4. 12
      src/main/resources/application-dev.yml

@ -51,7 +51,7 @@ public class WebMvcConfigurer extends WebMvcConfigurationSupport {
corsConfiguration.addAllowedOrigin("https://new.iasf.ac.cn"); //允许信任域名 corsConfiguration.addAllowedOrigin("https://new.iasf.ac.cn"); //允许信任域名
corsConfiguration.addAllowedOrigin("https://www.iasf.ac.cn"); //允许信任域名 corsConfiguration.addAllowedOrigin("https://www.iasf.ac.cn"); //允许信任域名
// corsConfiguration.addAllowedOrigin("http://192.168.31.125:8095"); //允许信任域名 // corsConfiguration.addAllowedOrigin("http://192.168.31.125:8095"); //允许信任域名
// corsConfiguration.addAllowedOrigin("http://192.168.31.125:8088"); //允许信任域名 corsConfiguration.addAllowedOrigin("http://192.168.31.125:8088"); //允许信任域名
corsConfiguration.addAllowedOrigin("http://10.10.11.7"); //允许信任域名 corsConfiguration.addAllowedOrigin("http://10.10.11.7"); //允许信任域名
corsConfiguration.addAllowedMethod("*"); // 允许任何方法(post、get等) corsConfiguration.addAllowedMethod("*"); // 允许任何方法(post、get等)
return corsConfiguration; return corsConfiguration;

@ -187,14 +187,14 @@ public class SysContentController {
} }
@PostMapping("/checkIfTheTitleIsRepeat") @PostMapping("/checkIfTheTitleIsRepeat")
@Decrypt // @Decrypt
@ApiOperation(value = "标题判重——只对已发布的判重(新增,编辑,点击发布时候都要调用判断))", response = ContentHeavyTitleReqVO.class) @ApiOperation(value = "标题判重——只对已发布的判重(新增,编辑,点击发布时候都要调用判断))", response = ContentHeavyTitleReqVO.class)
public R checkIfTheTitleIsRepeat(@RequestBody @Valid ContentHeavyTitleReqVO content) throws UnsupportedEncodingException { public R checkIfTheTitleIsRepeat(@RequestBody @Valid ContentHeavyTitleReqVO content) throws UnsupportedEncodingException {
if (!org.springframework.util.StringUtils.isEmpty(content.getTitle())) { // if (!org.springframework.util.StringUtils.isEmpty(content.getTitle())) {
//中文转码 // //中文转码
String name = URLDecoder.decode(content.getTitle(), StandardCharsets.UTF_8.toString()); // String name = URLDecoder.decode(content.getTitle(), StandardCharsets.UTF_8.toString());
content.setTitle(name); // content.setTitle(name);
} // }
return service.checkIfTheTitleIsRepeat(content) ? R.success() : R.fail("该标题已重复!"); return service.checkIfTheTitleIsRepeat(content) ? R.success() : R.fail("该标题已重复!");
} }

@ -135,7 +135,16 @@ public class UserController {
@RequiresPermissions("sys:user:add") @RequiresPermissions("sys:user:add")
@Decrypt @Decrypt
@LogAnnotation(title = "用户管理", action = "新增用户") @LogAnnotation(title = "用户管理", action = "新增用户")
public R addUser(@RequestBody @Valid SysUser vo) { public R addUser(@RequestBody @Valid SysUser vo) throws UnsupportedEncodingException {
//中文转码
if (!StringUtils.isEmpty(vo.getRealName())) {
String realName = URLDecoder.decode(vo.getRealName(), StandardCharsets.UTF_8.toString());
vo.setRealName(realName);
}
if (!StringUtils.isEmpty(vo.getUsername())) {
String realName = URLDecoder.decode(vo.getUsername(), StandardCharsets.UTF_8.toString());
vo.setUsername(realName);
}
userService.addUser(vo); userService.addUser(vo);
return R.success(); return R.success();
} }

@ -6,12 +6,12 @@ spring:
datasource: datasource:
master: master:
username: root username: root
password: 123456 # password: 123456
# password: iasf#2022 password: iasf#2022
# password: HuoRan@2021 # password: HuoRan@2021
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://127.0.0.1:3306/iasf?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=GMT%2b8 url: jdbc:mysql://127.0.0.1:3306/iasf?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=GMT%2b8
url: jdbc:mysql://192.168.31.136:3306/iasf?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=GMT%2b8 # url: jdbc:mysql://192.168.31.136:3306/iasf?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=GMT%2b8
# url: jdbc:mysql://139.9.47.170:3306/iasf?serverTimezone=GMT%2B8 # url: jdbc:mysql://139.9.47.170:3306/iasf?serverTimezone=GMT%2B8
cache: cache:
type: redis type: redis
@ -39,8 +39,8 @@ file:
url: /iasf/sysFiles/preview/ url: /iasf/sysFiles/preview/
# ip: http://10.10.11.7 # ip: http://10.10.11.7
ip: https://new.iasf.ac.cn ip: https://new.iasf.ac.cn
#knife4j: knife4j:
# production: true #生成环境禁用查看文档 production: true #生成环境禁用查看文档
#本地开启 #本地开启
# url: :10000/iasf/sysFiles/preview/ # url: :10000/iasf/sysFiles/preview/
Loading…
Cancel
Save