Compare commits

..

No commits in common. 'master' and '20240320' have entirely different histories.

  1. 39
      pom.xml
  2. 4
      src/main/java/com/huoran/iasf/common/config/WebMvcConfigurer.java
  3. 67
      src/main/java/com/huoran/iasf/common/filter/XssHttpServletRequestWrapper.java
  4. 4
      src/main/java/com/huoran/iasf/common/shiro/ShiroConfig.java
  5. 6
      src/main/java/com/huoran/iasf/common/utils/R.java
  6. 11
      src/main/java/com/huoran/iasf/controller/SysColumnController.java
  7. 17
      src/main/java/com/huoran/iasf/controller/SysContentClassificationController.java
  8. 21
      src/main/java/com/huoran/iasf/controller/SysContentController.java
  9. 4
      src/main/java/com/huoran/iasf/controller/SysContentFileController.java
  10. 16
      src/main/java/com/huoran/iasf/controller/SysContentLabelController.java
  11. 4
      src/main/java/com/huoran/iasf/controller/SysFilesController.java
  12. 11
      src/main/java/com/huoran/iasf/controller/UserController.java
  13. 3
      src/main/java/com/huoran/iasf/service/SysColumnService.java
  14. 9
      src/main/java/com/huoran/iasf/service/impl/SysColumnServiceImpl.java
  15. 13
      src/main/java/com/huoran/iasf/service/impl/SysFilesServiceImpl.java
  16. 5
      src/main/java/com/huoran/iasf/vo/resp/DeptRespNodeVO.java
  17. 5
      src/main/java/com/huoran/iasf/vo/resp/HomeRespVO.java
  18. 5
      src/main/java/com/huoran/iasf/vo/resp/LoginRespVO.java
  19. 5
      src/main/java/com/huoran/iasf/vo/resp/PageContentRespVO.java
  20. 5
      src/main/java/com/huoran/iasf/vo/resp/PermissionRespNode.java
  21. 4
      src/main/java/com/huoran/iasf/vo/resp/SortColumnRespVO.java
  22. 6
      src/main/java/com/huoran/iasf/vo/resp/UserInfoRespVO.java
  23. 6
      src/main/java/com/huoran/iasf/vo/resp/UserListResp.java
  24. 5
      src/main/java/com/huoran/iasf/vo/resp/UserOwnRoleRespVO.java
  25. 19
      src/main/resources/application-dev.yml

@ -52,15 +52,6 @@
<dependencies>
<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.17.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
@ -291,36 +282,6 @@
<skipTests>true</skipTests>
</configuration>
</plugin>
<!-- 加密插件,防止反编译 -->
<plugin>
<!-- https://gitee.com/roseboy/classfinal -->
<groupId>net.roseboy</groupId>
<artifactId>classfinal-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<!--加密密码,如果是#号,则使用无密码模式加密,【加密后没有pom文件,不用担心泄漏】-->
<password>#</password>
<!--加密的包名(可为空,多个用","分割)-->
<packages>com.huoran.iasf</packages>
<!--需要加密的配置文件,一般是classes目录下的yml或properties文件(可为空,多个用","分割)-->
<cfgfiles>*.properties,*.yml</cfgfiles>
<excludes>org.spring</excludes>
<!--外部依赖的jar目录,例如/tomcat/lib(可为空,多个用","分割)-->
<!--<classpath></classpath>-->
<!--运行命令: java -javaagent:iasf-encrypted.jar -jar iasf-encrypted.jar-->
<!--机器码获取命令:java -jar classfinal-fatjar-1.2.1.jar -C -->
<code>FDDEF78DF2FC3D09D733CBEAB15C3AEFD41D8CD98F00B204E9800998ECF8427ED41D8CD98F00B204E9800998ECF8427E</code>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>classFinal</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>

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

@ -5,9 +5,6 @@ import com.huoran.iasf.common.exception.BusinessException;
import com.huoran.iasf.common.exception.code.BaseResponseCode;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.safety.Safelist;
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
@ -146,19 +143,11 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
public ServletInputStream getInputStream() throws IOException {
// 非文件上传进行过滤
if (!fileUpload) {
try {
// 解析请求体为字符串
String bodyStr = new String(body, StandardCharsets.UTF_8);
// 清理HTML,只允许安全的元素和属性
Safelist safelist = Safelist.basicWithImages(); // 自定义safelist
String safeHtml = Jsoup.clean(bodyStr, "", safelist, new Document.OutputSettings().prettyPrint(false));
cleanSQLInject(safeHtml);
} catch (Exception e) {
// 处理解析或处理过程中的任何异常
log.error("Error processing request body {}", e.getMessage());
// 获取body中的请求参数
JSONObject json = JSONObject.parseObject(new String(body));
// 校验并过滤xss攻击和sql注入
for (String k : json.keySet()) {
cleanSQLInject(cleanXSS(json.getString(k)));
}
}
// 将请求体参数流转 -- 流读取一次就会消失,所以我们事先读取之后就存在byte数组里边方便流转
@ -186,35 +175,12 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
};
}
public String cleanXSS(String src) {
if (StringUtils.isBlank(src)) {
return src;
}
// 创建一个允许的HTML标签和属性的Safelist
Safelist safelist = Safelist.relaxed() // 允许大多数基本的HTML标签和属性
.addTags("img") // 添加额外的标签,如img(记得添加允许的属性,如src和alt)
.addAttributes("*", "class") // 允许所有标签使用"class"属性
.addAttributes("img", "src", "alt") // 允许img标签的src和alt属性
.addProtocols("img", "src", "http", "https") // 只允许http和https协议的src
; // 移除协议相对URL,避免安全问题
// 使用JSoup进行清理
Document document = Jsoup.parseBodyFragment(src, ""); // 解析HTML片段
document.outputSettings(new Document.OutputSettings().prettyPrint(false)); // 禁止美化输出,保持原始结构
String html = document.html();
String clean = Jsoup.clean(html, "", safelist);// 使用Safelist进行清理
return clean; // 返回清理后的HTML字符串
}
/**
* 清除xss
* @param src 单个参数
* @return
*/
/*public String cleanXSS(String src) {
public String cleanXSS(String src) {
if(StringUtils.isBlank(src)){
return src;
}
@ -236,7 +202,7 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
}
return src;
}*/
}
/**
* 过滤sql注入 -- 需要增加通配过滤大小写组合
@ -247,19 +213,12 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
if(StringUtils.isBlank(src)){
return src;
}
String cleanedText = Jsoup.clean(src, Safelist.basic());
String SQL_KEYWORD_PATTERN =
"(?i)(?:(?!<[^>]*?>))((select|update|insert|delete|drop|create|alter|exec|union|table|database)[^a-zA-Z0-9])";
// 过滤SQL关键字
cleanedText = cleanedText.replaceAll(SQL_KEYWORD_PATTERN, "");
// 非法sql注入正则
// Pattern sqlPattern = Pattern.compile(badStrReg, Pattern.CASE_INSENSITIVE);
// if (sqlPattern.matcher(src.toLowerCase()).find()) {
// log.error("sql注入检查:输入信息存在SQL攻击!");
// throw new BusinessException(BaseResponseCode.SQL_FILTER);
// }
return cleanedText;
Pattern sqlPattern = Pattern.compile(badStrReg, Pattern.CASE_INSENSITIVE);
if (sqlPattern.matcher(src.toLowerCase()).find()) {
log.error("sql注入检查:输入信息存在SQL攻击!");
throw new BusinessException(BaseResponseCode.SQL_FILTER);
}
return src;
}
}

@ -148,7 +148,7 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/sysContent/queryArticleColumnParent", "anon");
/*filterChainDefinitionMap.put("/index/**", "anon");
filterChainDefinitionMap.put("/iasf/doc.html", "anon");
filterChainDefinitionMap.put("/doc.html", "anon");
filterChainDefinitionMap.put("/swagger-resources/**", "anon");
filterChainDefinitionMap.put("/v2/api-docs", "anon");
filterChainDefinitionMap.put("/v2/api-docs-ext", "anon");
@ -156,7 +156,7 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/static/**", "anon");
filterChainDefinitionMap.put("/webjars/**", "anon");
filterChainDefinitionMap.put("/druid/**", "anon");
filterChainDefinitionMap.put("/iasf/favicon.ico", "anon");
filterChainDefinitionMap.put("/favicon.ico", "anon");
filterChainDefinitionMap.put("/captcha.jpg", "anon");
filterChainDefinitionMap.put("/csrf", "anon");
//文件上传可直接访问

@ -5,8 +5,6 @@ import com.huoran.iasf.common.exception.code.ResponseCodeInterface;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* 返回值R
*
@ -15,9 +13,7 @@ import java.io.Serializable;
* @date 2022年7月28日
*/
@Data
public class R implements Serializable {
// 类的内容
private static final long serialVersionUID = 1L;
public class R {
/**
* 请求响应code0为成功 其他为失败

@ -19,8 +19,6 @@ import com.huoran.iasf.common.utils.R;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -110,7 +108,7 @@ public class SysColumnController {
return R.success(sysColumn);
}
// @NoRepeatSubmit
@NoRepeatSubmit
@PostMapping("/save")
@ApiOperation(value = "新增", response = SysColumn.class)
@RequiresPermissions("sys:column:save")
@ -128,7 +126,6 @@ public class SysColumnController {
@RequiresPermissions("sys:column:update")
public R update(@RequestBody SysColumn sysColumn) {
boolean updateState = service.updateById(sysColumn);
service.removeArticles(sysColumn.getId());
return updateState ? R.success() : R.fail("编辑失败");
}
@ -187,15 +184,13 @@ public class SysColumnController {
//删除栏目后删除栏目下的文章
sysColumnLongPageService.remove(queryWrapper1);
ret = service.removeByIds(idList);
for (Integer columnId : idList) {
service.removeArticles(columnId);
}
}
return R.success();
}
@PostMapping("/sameLevelJudgment")
@Decrypt
@ApiOperation(value = "同级判重", response = ColumnWeightReqVO.class)
@ -254,7 +249,7 @@ public class SysColumnController {
}
// @Cacheable(value = "articles", key = "#id")
public String getIds(Integer id) {
//1 创建list集合,用于封装所有删除菜单id值
List<Integer> idList = new ArrayList<>();

@ -24,9 +24,6 @@ import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import javax.validation.Valid;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.List;
@ -70,9 +67,8 @@ public class SysContentClassificationController {
@Decrypt
@ApiOperation(value = "分类校验判重", response = SysContentClassification.class)
public R checkForHeavy(
@RequestBody CheckForHeavy checkForHeavy) throws UnsupportedEncodingException {
String name = URLDecoder.decode(checkForHeavy.getClassificationName(), StandardCharsets.UTF_8.toString());
checkForHeavy.setClassificationName(name);
@RequestBody CheckForHeavy checkForHeavy) {
QueryWrapper<SysContentClassification> queryWrapper = new QueryWrapper<SysContentClassification>().eq("site_id", checkForHeavy.getSiteId()).
eq("classification_name", checkForHeavy.getClassificationName());
@ -92,10 +88,7 @@ public class SysContentClassificationController {
@PostMapping("/save")
@Decrypt
@ApiOperation(value = "新增", response = SysContentClassification.class)
public R save(@RequestBody @Valid @ApiParam(name = "文章所属分类对象", value = "传入json格式", required = true) SysContentClassification sysContentClassification) throws UnsupportedEncodingException {
String name = URLDecoder.decode(sysContentClassification.getClassificationName(), StandardCharsets.UTF_8.toString());
sysContentClassification.setClassificationName(name);
public R save(@RequestBody @Valid @ApiParam(name = "文章所属分类对象", value = "传入json格式", required = true) SysContentClassification sysContentClassification) {
boolean addState = service.save(sysContentClassification);
return addState ? R.success() : R.fail("新增失败");
}
@ -104,9 +97,7 @@ public class SysContentClassificationController {
@PostMapping("/update")
@Decrypt
@ApiOperation(value = "修改", response = SysContentClassification.class)
public R update(@RequestBody @ApiParam(name = "文章所属分类对象", value = "传入json格式", required = true) SysContentClassification sysContentClassification) throws UnsupportedEncodingException {
String name = URLDecoder.decode(sysContentClassification.getClassificationName(), StandardCharsets.UTF_8.toString());
sysContentClassification.setClassificationName(name);
public R update(@RequestBody @ApiParam(name = "文章所属分类对象", value = "传入json格式", required = true) SysContentClassification sysContentClassification) {
boolean updateState = service.updateById(sysContentClassification);
return updateState ? R.success() : R.fail("编辑失败");
}

@ -141,7 +141,7 @@ public class SysContentController {
}
sysContent.setSequence(count + 1);*/
boolean addState = service.save(sysContent);
columnService.removeArticles(sysContent.getColumnId());
return addState ? R.success(sysContent.getId()) : R.fail("新增失败");
}
@ -152,7 +152,6 @@ public class SysContentController {
@ApiOperation(value = "修改", response = SysContent.class)
public R update(@RequestBody @ApiParam(name = "文章管理对象", value = "传入json格式", required = true) SysContent sysContent) {
boolean updateState = service.updateById(sysContent);
columnService.removeArticles(sysContent.getColumnId());
return updateState ? R.success() : R.fail("编辑失败");
}
@ -167,8 +166,6 @@ public class SysContentController {
queryWrapper.eq("quote_type", 0);
queryWrapper.set("is_del", 1);
sysFilesService.update(queryWrapper);
SysContent sysContent = service.getById(id);
columnService.removeArticles(sysContent.getColumnId());
boolean delState = service.removeById(id);
return delState ? R.success() : R.fail("删除失败");
}
@ -179,8 +176,6 @@ public class SysContentController {
@ApiOperation(value = "批量删除文章", response = SysContent.class)
public R batchDeletion(@ApiParam(name = "ids", value = "主键", required = true) @RequestBody List<Integer> ids) {
for (Integer id : ids) {
SysContent sysContent = service.getById(id);
columnService.removeArticles(sysContent.getColumnId());
UpdateWrapper<SysFilesEntity> queryWrapper = new UpdateWrapper<>();
queryWrapper.eq("quote_id", id);
queryWrapper.eq("quote_type", 0);
@ -192,14 +187,14 @@ public class SysContentController {
}
@PostMapping("/checkIfTheTitleIsRepeat")
// @Decrypt
@Decrypt
@ApiOperation(value = "标题判重——只对已发布的判重(新增,编辑,点击发布时候都要调用判断))", response = ContentHeavyTitleReqVO.class)
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);
// }
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("该标题已重复!");
}
@ -304,8 +299,6 @@ public class SysContentController {
//是否置顶(默认为0 不置顶 1为置顶)
UpdateWrapper<SysContent> updateWrap = new UpdateWrapper<>();
// columnService.removeArticles(columnId);
if (articleTopOperation.getIsTop() == 1) {
//置顶时间(置顶一次更新一次)
updateWrap.set("top_time", new Date());

@ -48,7 +48,7 @@ public class SysContentFileController {
return R.success(sysContentFile);
}
// @NoRepeatSubmit
@NoRepeatSubmit
@PostMapping("/save")
@ApiOperation(value = "新增", response = SysContentFile.class)
public R save(@RequestBody @ApiParam(name = "文章附件管理表对象", value = "传入json格式", required = true) SysContentFile sysContentFile) {
@ -64,7 +64,7 @@ public class SysContentFileController {
return updateState ? R.success() : R.fail("编辑失败");
}
// @NoRepeatSubmit
@NoRepeatSubmit
@PostMapping("/delete")
@ApiOperation(value = "删除", response = SysContentFile.class)
public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) {

@ -21,9 +21,6 @@ import org.springframework.web.bind.annotation.RequestParam;
import io.swagger.annotations.ApiOperation;
import javax.validation.Valid;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.List;
@ -66,9 +63,7 @@ public class SysContentLabelController {
@PostMapping("/save")
@Decrypt
@ApiOperation(value = "新增", response = SysContentLabel.class)
public R save(@RequestBody @Valid @ApiParam(name = "文章主题标签对象", value = "传入json格式", required = true) SysContentLabel sysContentLabel) throws UnsupportedEncodingException {
String name = URLDecoder.decode(sysContentLabel.getLabelName(), StandardCharsets.UTF_8.toString());
sysContentLabel.setLabelName(name);
public R save(@RequestBody @Valid @ApiParam(name = "文章主题标签对象", value = "传入json格式", required = true) SysContentLabel sysContentLabel) {
boolean addState = service.save(sysContentLabel);
return addState ? R.success() : R.fail("新增失败");
}
@ -78,9 +73,8 @@ public class SysContentLabelController {
@Decrypt
@ApiOperation(value = "标签校验判重", response = SysContentLabel.class)
public R checkForHeavy(
@RequestBody LabelCheckForHeavy labelCheckForHeavy) throws UnsupportedEncodingException {
String name = URLDecoder.decode(labelCheckForHeavy.getLabelName(), StandardCharsets.UTF_8.toString());
labelCheckForHeavy.setLabelName(name);
@RequestBody LabelCheckForHeavy labelCheckForHeavy) {
QueryWrapper<SysContentLabel> queryWrapper = new QueryWrapper<SysContentLabel>().
eq("site_id", labelCheckForHeavy.getSiteId()).eq("label_name", labelCheckForHeavy.getLabelName());
@ -100,9 +94,7 @@ public class SysContentLabelController {
@PostMapping("/update")
@Decrypt
@ApiOperation(value = "修改", response = SysContentLabel.class)
public R update(@RequestBody @ApiParam(name = "文章主题标签对象", value = "传入json格式", required = true) SysContentLabel sysContentLabel) throws UnsupportedEncodingException {
String name = URLDecoder.decode(sysContentLabel.getLabelName(), StandardCharsets.UTF_8.toString());
sysContentLabel.setLabelName(name);
public R update(@RequestBody @ApiParam(name = "文章主题标签对象", value = "传入json格式", required = true) SysContentLabel sysContentLabel) {
boolean updateState = service.updateById(sysContentLabel);
return updateState ? R.success() : R.fail("编辑失败");
}

@ -75,7 +75,7 @@ public class SysFilesController {
result.put("imageFieldName", "file");
return result.toJSONString();
}
// @NoRepeatSubmit
@NoRepeatSubmit
@ApiOperation(value = "新增")
@PostMapping("/upload")
// @RequiresPermissions(value = {"sysFiles:add", "sysContent:update", "sysContent:add"}, logical = Logical.OR)
@ -119,7 +119,7 @@ public class SysFilesController {
public void preview(@PathVariable String id, HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
sysFilesService.preview(id, req, res);
}
// @NoRepeatSubmit
@NoRepeatSubmit
@ApiOperation(value = "文件下载")
@GetMapping("/download/{id}")
public void download(@PathVariable String id, HttpServletRequest req, HttpServletResponse res) {

@ -135,16 +135,7 @@ public class UserController {
@RequiresPermissions("sys:user:add")
@Decrypt
@LogAnnotation(title = "用户管理", action = "新增用户")
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);
}
public R addUser(@RequestBody @Valid SysUser vo) {
userService.addUser(vo);
return R.success();
}

@ -7,7 +7,6 @@ import com.huoran.iasf.vo.req.ColumnWeightReqVO;
import com.huoran.iasf.vo.req.LongPageColumnReqVO;
import com.huoran.iasf.vo.req.PageContentReqVO;
import com.huoran.iasf.vo.req.PaginationColumnReqVO;
import org.springframework.cache.annotation.CacheEvict;
import java.util.List;
@ -32,7 +31,7 @@ public interface SysColumnService extends IService<SysColumn> {
R getsTheSubColumn(Integer parentId,String ids,Integer siteId);
void removeArticles(Integer columnId);
R getsSublevelColumnsUnderALevel(Integer parentId,String ids,Integer siteId);

@ -18,8 +18,6 @@ import com.huoran.iasf.vo.req.PageContentReqVO;
import com.huoran.iasf.vo.req.PaginationColumnReqVO;
import com.huoran.iasf.vo.resp.PageContentRespVO;
import org.springframework.beans.BeanUtils;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
@ -156,12 +154,6 @@ public class SysColumnServiceImpl extends ServiceImpl<SysColumnMapper, SysColumn
return R.success(pageList);
}
@Override
// @CacheEvict(value = "articles", key = "#id")
public void removeArticles(Integer id) {
}
@Override
public R getsTheSubColumn(Integer pid, String ids,Integer siteId) {
@ -190,7 +182,6 @@ public class SysColumnServiceImpl extends ServiceImpl<SysColumnMapper, SysColumn
}
@Override
// @Cacheable(value = "articles", key = "#id")
public R queryArticlesByColumnType(String ids, Integer id) {
Integer count = 0;

@ -21,8 +21,6 @@ import com.huoran.iasf.vo.req.FileParameters;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
@ -195,8 +193,6 @@ public class SysFilesServiceImpl extends ServiceImpl<SysFilesMapper, SysFilesEnt
@Override
// 缓存预览结果,使用id作为缓存键
// @Cacheable(value = "preview", key = "#id")
public void preview(String id, HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
if (id != null) {
SysFilesEntity entity = this.getById(id);
@ -214,9 +210,6 @@ public class SysFilesServiceImpl extends ServiceImpl<SysFilesMapper, SysFilesEnt
//判断类型,根据不同的类型文件来处理对应的数据
res.setContentType(mimeType);
res.addHeader("Content-Length", "" + file.length());
res.setHeader("Cache-Control", "public, max-age=31536000");
res.setDateHeader("Expires", System.currentTimeMillis() + 31536000000L);
}
//转换视频流部分
req.setAttribute(NonStaticResourceHttpRequestConfig.ATTR_FILE, filePath);
@ -300,15 +293,9 @@ public class SysFilesServiceImpl extends ServiceImpl<SysFilesMapper, SysFilesEnt
if (file.exists()) {
file.delete();
}
removePreview(entity.getId());
});
this.removeByIds(ids);
}
// 删除预览结果的缓存,同样使用id作为键
// @CacheEvict(value = "preview", key = "#id")
public void removePreview(String id) {
}
/**

@ -3,7 +3,6 @@ package com.huoran.iasf.vo.resp;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
@ -14,9 +13,7 @@ import java.util.List;
* @date 2022年7月28日
*/
@Data
public class DeptRespNodeVO implements Serializable {
// 类的内容
private static final long serialVersionUID = 1L;
public class DeptRespNodeVO {
@ApiModelProperty(value = "组织id")
private Integer id;

@ -3,7 +3,6 @@ package com.huoran.iasf.vo.resp;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
@ -14,9 +13,7 @@ import java.util.List;
* @date 2022年7月28日
*/
@Data
public class HomeRespVO implements Serializable {
// 类的内容
private static final long serialVersionUID = 1L;
public class HomeRespVO {
@ApiModelProperty(value = "用户信息")
private UserInfoRespVO userInfo;
@ApiModelProperty(value = "目录菜单")

@ -4,7 +4,6 @@ import com.huoran.iasf.entity.SysPermission;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
@ -15,9 +14,7 @@ import java.util.List;
* @date 2022年7月28日
*/
@Data
public class LoginRespVO implements Serializable {
// 类的内容
private static final long serialVersionUID = 1L;
public class LoginRespVO {
@ApiModelProperty(value = "token")
private String accessToken;
@ApiModelProperty(value = "用户名")

@ -7,7 +7,6 @@ import com.huoran.iasf.vo.FatherContentRespVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@ -17,9 +16,7 @@ import java.util.List;
* @日期: 2022-08-05
*/
@Data
public class PageContentRespVO implements Serializable {
// 类的内容
private static final long serialVersionUID = 1L;
public class PageContentRespVO {
@TableId(type = IdType.AUTO)

@ -3,7 +3,6 @@ package com.huoran.iasf.vo.resp;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
@ -14,9 +13,7 @@ import java.util.List;
* @date 2022年7月28日
*/
@Data
public class PermissionRespNode implements Serializable {
// 类的内容
private static final long serialVersionUID = 1L;
public class PermissionRespNode {
@ApiModelProperty(value = "id")
private Integer id;

@ -16,9 +16,7 @@ import java.util.List;
* @日期: 2022-08-03
*/
@Data
public class SortColumnRespVO implements Serializable {
// 类的内容
private static final long serialVersionUID = 1L;
public class SortColumnRespVO {
@TableId(type = IdType.AUTO)

@ -3,8 +3,6 @@ package com.huoran.iasf.vo.resp;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* UserInfoRespVO
*
@ -13,9 +11,7 @@ import java.io.Serializable;
* @date 2022年7月28日
*/
@Data
public class UserInfoRespVO implements Serializable {
// 类的内容
private static final long serialVersionUID = 1L;
public class UserInfoRespVO {
@ApiModelProperty(value = "用户id")
private String id;
@ApiModelProperty(value = "账号")

@ -6,8 +6,6 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* @Author chen
* @DATE 2022/8/15 15:34
@ -17,9 +15,7 @@ import java.io.Serializable;
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "UserListResp", description = "用户列表")
public class UserListResp implements Serializable {
// 类的内容
private static final long serialVersionUID = 1L;
public class UserListResp {
@ApiModelProperty(value = "组织架构ID")
private String deptArchitectureId;

@ -4,7 +4,6 @@ import com.huoran.iasf.entity.SysRole;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
@ -15,9 +14,7 @@ import java.util.List;
* @date 2022年7月28日
*/
@Data
public class UserOwnRoleRespVO implements Serializable {
// 类的内容
private static final long serialVersionUID = 1L;
public class UserOwnRoleRespVO {
@ApiModelProperty("所有角色集合")
private List<SysRole> allRole;
@ApiModelProperty(value = "用户所拥有角色集合")

@ -6,12 +6,12 @@ spring:
datasource:
master:
username: root
# password: 123456
password: iasf#2022
password: 123456
# password: iasf#2022
# password: HuoRan@2021
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://192.168.31.136: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://139.9.47.170:3306/iasf?serverTimezone=GMT%2B8
cache:
type: redis
@ -37,9 +37,10 @@ file:
path: C:/files/
#文件预览url
url: /iasf/sysFiles/preview/
#本地开启
# url: :10000/iasf/sysFiles/preview/
# ip: http://192.168.31.51
# ip: http://10.10.11.7
ip: https://new.iasf.ac.cn
knife4j:
production: true #生成环境禁用查看文档
#knife4j:
# production: true #生成环境禁用查看文档
#本地开启
# url: :10000/iasf/sysFiles/preview/
Loading…
Cancel
Save