mirror of
https://github.com/1024-lab/smart-admin.git
synced 2025-09-09 09:49:34 +00:00
v3.0.1
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