mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-16 07:33: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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user