mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-12 13:43:49 +08:00
【v3.0.1】1、【新增】tomcat访问日志accessslog 最大保存天数;2、【新增】获取登录结果信息接口返回 Token;3、【新增】员工列表、表单 新增超级管理员标识;4、【优化】移除dev环境swagger用户名和密码;5、【优化】成功返回消息内容改为"操作成功";6、【优化】代码下载zip文件名改为 下划线,eg:t_apply_code.zip;7、【优化】Service代码生成自动Import;8、【优化】AdminInterpter 拦截器中对超级管理员放行;9、【优化】优化重复提交RepeatSubmitAspect;10、【优化】修改其他bug
This commit is contained in:
@@ -24,7 +24,7 @@ public class ResponseDTO<T> {
|
||||
|
||||
public static final int OK_CODE = 0;
|
||||
|
||||
public static final String OK_MSG = "success";
|
||||
public static final String OK_MSG = "操作成功";
|
||||
|
||||
@Schema(description = "返回码")
|
||||
private Integer code;
|
||||
|
||||
@@ -87,7 +87,7 @@ public class CodeGeneratorController extends SupportBaseController {
|
||||
ResponseDTO<byte[]> download = codeGeneratorService.download(tableName);
|
||||
|
||||
if (download.getOk()) {
|
||||
SmartResponseUtil.setDownloadFileHeader(response, tableName + "-code.zip", (long) download.getData().length);
|
||||
SmartResponseUtil.setDownloadFileHeader(response, tableName + "_code.zip", (long) download.getData().length);
|
||||
response.getOutputStream().write(download.getData());
|
||||
} else {
|
||||
SmartResponseUtil.write(response, download);
|
||||
|
||||
@@ -55,22 +55,15 @@ public class RepeatSubmitAspect {
|
||||
if (StringUtils.isEmpty(ticket)) {
|
||||
return point.proceed();
|
||||
}
|
||||
Long timeStamp = this.repeatSubmitTicket.getTicketTimestamp(ticket);
|
||||
if (timeStamp != null) {
|
||||
Long lastRequestTime = this.repeatSubmitTicket.getTicketTimestamp(ticket);
|
||||
if (lastRequestTime != null) {
|
||||
Method method = ((MethodSignature) point.getSignature()).getMethod();
|
||||
RepeatSubmit annotation = method.getAnnotation(RepeatSubmit.class);
|
||||
|
||||
// 说明注解去掉了
|
||||
if (annotation != null) {
|
||||
return point.proceed();
|
||||
}
|
||||
|
||||
int interval = Math.min(annotation.value(), RepeatSubmit.MAX_INTERVAL);
|
||||
if (System.currentTimeMillis() < timeStamp + interval) {
|
||||
if (System.currentTimeMillis() < lastRequestTime + interval) {
|
||||
// 提交频繁
|
||||
return ResponseDTO.error(UserErrorCode.REPEAT_SUBMIT);
|
||||
}
|
||||
|
||||
}
|
||||
Object obj = null;
|
||||
try {
|
||||
@@ -80,8 +73,6 @@ public class RepeatSubmitAspect {
|
||||
} catch (Throwable throwable) {
|
||||
log.error("", throwable);
|
||||
throw throwable;
|
||||
} finally {
|
||||
this.repeatSubmitTicket.removeTicket(ticket);
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.lab1024.sa.base.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.base.common.domain.PageResult;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
||||
@@ -62,9 +62,9 @@ server:
|
||||
basedir: ${project.log-directory}/tomcat-logs
|
||||
accesslog:
|
||||
enabled: true
|
||||
max-days: 7
|
||||
pattern: "%t %{X-Forwarded-For}i %a %r %s (%D ms) %I (%B byte)"
|
||||
|
||||
|
||||
# 文件上传 配置
|
||||
file:
|
||||
storage:
|
||||
@@ -81,7 +81,6 @@ file:
|
||||
url-prefix: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/
|
||||
private-url-expire-seconds: 3600
|
||||
|
||||
|
||||
# open api配置
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
@@ -93,7 +92,7 @@ springdoc:
|
||||
knife4j:
|
||||
enable: true
|
||||
basic:
|
||||
enable: true
|
||||
enable: false
|
||||
username: api # Basic认证用户名
|
||||
password: 1024 # Basic认证密码
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ server:
|
||||
basedir: ${project.log-directory}/tomcat-logs
|
||||
accesslog:
|
||||
enabled: true
|
||||
max-days: 7
|
||||
pattern: "%t %{X-Forwarded-For}i %a %r %s (%D ms) %I (%B byte)"
|
||||
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ server:
|
||||
basedir: ${project.log-directory}/tomcat-logs
|
||||
accesslog:
|
||||
enabled: true
|
||||
max-days: 30
|
||||
pattern: "%t %{X-Forwarded-For}i %a %r %s (%D ms) %I (%B byte)"
|
||||
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ server:
|
||||
basedir: ${project.log-directory}/tomcat-logs
|
||||
accesslog:
|
||||
enabled: true
|
||||
max-days: 7
|
||||
pattern: "%t %{X-Forwarded-For}i %a %r %s (%D ms) %I (%B byte)"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user