搜索加密

master
cheney 9 months ago
parent 1ad54fa4ca
commit 1d7e279bf7
  1. 2
      src/main/java/com/huoran/iasf/common/config/WebMvcConfigurer.java
  2. 8
      src/main/java/com/huoran/iasf/controller/SysColumnController.java
  3. 5
      src/main/java/com/huoran/iasf/controller/SysColumnLongPageController.java
  4. 19
      src/main/java/com/huoran/iasf/controller/SysContentController.java
  5. 6
      src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml

@ -50,7 +50,7 @@ public class WebMvcConfigurer extends WebMvcConfigurationSupport {
// corsConfiguration.addAllowedOrigin("*"); // 允许任何头 // corsConfiguration.addAllowedOrigin("*"); // 允许任何头
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:8088"); //允许信任域名 corsConfiguration.addAllowedOrigin("http://192.168.31.125:8095"); //允许信任域名
corsConfiguration.addAllowedOrigin("http://192.168.31.125:8089"); //允许信任域名 corsConfiguration.addAllowedOrigin("http://192.168.31.125:8089"); //允许信任域名
corsConfiguration.addAllowedOrigin("http://10.10.11.7"); //允许信任域名 corsConfiguration.addAllowedOrigin("http://10.10.11.7"); //允许信任域名
corsConfiguration.addAllowedMethod("*"); // 允许任何方法(post、get等) corsConfiguration.addAllowedMethod("*"); // 允许任何方法(post、get等)

@ -192,8 +192,14 @@ public class SysColumnController {
@PostMapping("/sameLevelJudgment") @PostMapping("/sameLevelJudgment")
@Decrypt
@ApiOperation(value = "同级判重", response = ColumnWeightReqVO.class) @ApiOperation(value = "同级判重", response = ColumnWeightReqVO.class)
public R sameLevelJudgment(@RequestBody @Valid ColumnWeightReqVO sysColumn) { public R sameLevelJudgment(@RequestBody @Valid ColumnWeightReqVO sysColumn) throws UnsupportedEncodingException {
if (!StringUtils.isEmpty(sysColumn.getColumnName())) {
//中文转码
String name = URLDecoder.decode(sysColumn.getColumnName(), StandardCharsets.UTF_8.toString());
sysColumn.setColumnName(name);
}
return service.sameLevelJudgment(sysColumn) ? R.success() : R.fail("同级下已存在重复栏目!"); return service.sameLevelJudgment(sysColumn) ? R.success() : R.fail("同级下已存在重复栏目!");
} }

@ -129,8 +129,11 @@ public class SysColumnLongPageController {
@PostMapping("/getRedisCache") @PostMapping("/getRedisCache")
@Decrypt
@ApiOperation(value = "获取Redis缓存") @ApiOperation(value = "获取Redis缓存")
public R getRedisCache(@ApiParam(name = "columnId", value = "栏目id主键", required = true) @RequestParam Integer columnId) { public R getRedisCache(
@ApiParam(name = "columnId", value = "栏目id主键", required = true)
@RequestBody Integer columnId) {
//保存的key名 //保存的key名
String key = "saveTheCache:columnId:" + columnId; String key = "saveTheCache:columnId:" + columnId;
//查看缓存是否有数据 //查看缓存是否有数据

@ -189,7 +189,12 @@ 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) { public R checkIfTheTitleIsRepeat(@RequestBody @Valid ContentHeavyTitleReqVO content) throws UnsupportedEncodingException {
if (!org.springframework.util.StringUtils.isEmpty(content.getTitle())) {
//中文转码
String name = URLDecoder.decode(content.getTitle(), StandardCharsets.UTF_8.toString());
content.setTitle(name);
}
return service.checkIfTheTitleIsRepeat(content) ? R.success() : R.fail("该标题已重复!"); return service.checkIfTheTitleIsRepeat(content) ? R.success() : R.fail("该标题已重复!");
} }
@ -202,6 +207,18 @@ public class SysContentController {
String title = URLDecoder.decode(content.getTitle(), StandardCharsets.UTF_8.toString()); String title = URLDecoder.decode(content.getTitle(), StandardCharsets.UTF_8.toString());
content.setTitle(title); content.setTitle(title);
} }
if (!StringUtils.isEmpty(content.getPatentQueryKeyWord())) {
String title = URLDecoder.decode(content.getPatentQueryKeyWord(), StandardCharsets.UTF_8.toString());
content.setPatentQueryKeyWord(title);
}
if (!StringUtils.isEmpty(content.getMonographQueryKeyWord())) {
String title = URLDecoder.decode(content.getMonographQueryKeyWord(), StandardCharsets.UTF_8.toString());
content.setMonographQueryKeyWord(title);
}
if (!StringUtils.isEmpty(content.getPaperQueryKeyWord())) {
String title = URLDecoder.decode(content.getPaperQueryKeyWord(), StandardCharsets.UTF_8.toString());
content.setPaperQueryKeyWord(title);
}
return service.newlyPublishedArticles(content); return service.newlyPublishedArticles(content);
} }

@ -88,8 +88,8 @@
( (
SELECT SELECT
s.*, s.*,
( SELECT GROUP_CONCAT( label_name ) FROM sys_content_label l WHERE deleted = 1 AND FIND_IN_SET( l.id, s.lable_id ( SELECT GROUP_CONCAT( l.id ) FROM sys_content_label l WHERE deleted = 1 AND FIND_IN_SET( l.id, s.lable_id
) ) AS labelName, ) ) AS labelId,
( SELECT c.classification_name FROM sys_content_classification c WHERE deleted = 1 AND s.classification_id = ( SELECT c.classification_name FROM sys_content_classification c WHERE deleted = 1 AND s.classification_id =
c.id ) AS classificationName , c.id ) AS classificationName ,
(SELECT c.column_name from sys_column c WHERE c.id = s.column_id) as columnName (SELECT c.column_name from sys_column c WHERE c.id = s.column_id) as columnName
@ -107,7 +107,7 @@
<if test="req.labelName != null and req.labelName.size() > 0 "> <if test="req.labelName != null and req.labelName.size() > 0 ">
and and
<foreach collection="req.labelName" item="item" index="index" open="(" separator="or" close=")"> <foreach collection="req.labelName" item="item" index="index" open="(" separator="or" close=")">
t.labelName LIKE CONCAT('%',#{item},'%') FIND_IN_SET( #{item}, t.labelId)
</foreach> </foreach>
</if> </if>

Loading…
Cancel
Save