diff --git a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/interceptor/AdminInterceptor.java b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/interceptor/AdminInterceptor.java index 7e754860..5523531b 100644 --- a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/interceptor/AdminInterceptor.java +++ b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/interceptor/AdminInterceptor.java @@ -67,7 +67,7 @@ public class AdminInterceptor implements HandlerInterceptor { Method method = ((HandlerMethod) handler).getMethod(); NoNeedLogin noNeedLogin = ((HandlerMethod) handler).getMethodAnnotation(NoNeedLogin.class); if (noNeedLogin != null) { - checkActiveTimeout(requestEmployee); + updateActiveTimeout(requestEmployee); SmartRequestUtil.setRequestUser(requestEmployee); return true; } @@ -77,8 +77,8 @@ public class AdminInterceptor implements HandlerInterceptor { return false; } - // 检测token 活跃频率 - checkActiveTimeout(requestEmployee); + // 更新活跃 + updateActiveTimeout(requestEmployee); // --------------- 第三步: 校验 权限 --------------- @@ -123,15 +123,12 @@ public class AdminInterceptor implements HandlerInterceptor { /** - * 检测:token 最低活跃频率(单位:秒),如果 token 超过此时间没有访问系统就会被冻结 + * 更新活跃时间 */ - private void checkActiveTimeout(RequestEmployee requestEmployee) { - // 用户不在线,也不用检测 + private void updateActiveTimeout(RequestEmployee requestEmployee) { if (requestEmployee == null) { return; } - - StpUtil.checkActiveTimeout(); StpUtil.updateLastActiveToNow(); } diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/config/FileConfig.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/config/FileConfig.java index 98eb03fe..97dce114 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/config/FileConfig.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/config/FileConfig.java @@ -81,7 +81,7 @@ public class FileConfig implements WebMvcConfigurer { StaticCredentialsProvider.create( AwsBasicCredentials.create(accessKey, secretKey))) .serviceConfiguration(S3Configuration.builder() - .pathStyleAccessEnabled(false) + .pathStyleAccessEnabled(true) .chunkedEncodingEnabled(false) .build()) .build(); diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/file/service/FileStorageCloudServiceImpl.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/file/service/FileStorageCloudServiceImpl.java index 8de329a5..45664ec8 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/file/service/FileStorageCloudServiceImpl.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/file/service/FileStorageCloudServiceImpl.java @@ -101,7 +101,18 @@ public class FileStorageCloudServiceImpl implements IFileStorageService { userMetadata.put(USER_METADATA_FILE_FORMAT, fileType); userMetadata.put(USER_METADATA_FILE_SIZE, String.valueOf(file.getSize())); - PutObjectRequest putObjectRequest = PutObjectRequest.builder().bucket(cloudConfig.getBucketName()).key(fileKey).metadata(userMetadata).contentLength(file.getSize()).contentType(this.getContentType(fileType)).contentEncoding(StandardCharsets.UTF_8.name()).contentDisposition("attachment;filename=" + urlEncoderFilename).build(); + // 根据文件路径获取并设置访问权限 + ObjectCannedACL acl = this.getACL(path); + PutObjectRequest putObjectRequest = PutObjectRequest.builder() + .bucket(cloudConfig.getBucketName()) + .key(fileKey) + .metadata(userMetadata) + .contentLength(file.getSize()) + .contentType(this.getContentType(fileType)) + .contentEncoding(StandardCharsets.UTF_8.name()) + .contentDisposition("attachment;filename=" + urlEncoderFilename) + .acl(acl) + .build(); InputStream inputStream = null; try { inputStream = file.getInputStream(); @@ -112,10 +123,6 @@ public class FileStorageCloudServiceImpl implements IFileStorageService { } finally { IOUtils.closeQuietly(inputStream); } - // 根据文件路径获取并设置访问权限 - ObjectCannedACL acl = this.getACL(path); - PutObjectAclRequest aclRequest = PutObjectAclRequest.builder().bucket(cloudConfig.getBucketName()).key(fileKey).acl(this.getACL(path)).build(); - s3Client.putObjectAcl(aclRequest); // 返回上传结果 FileUploadVO uploadVO = new FileUploadVO(); uploadVO.setFileName(originalFileName); diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/core/OperateLogAspect.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/core/OperateLogAspect.java index 19349e77..038a0f55 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/core/OperateLogAspect.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/core/OperateLogAspect.java @@ -11,6 +11,7 @@ import jakarta.servlet.http.HttpServletResponse; import lombok.extern.slf4j.Slf4j; import net.lab1024.sa.base.common.constant.StringConst; import net.lab1024.sa.base.common.domain.RequestUser; +import net.lab1024.sa.base.common.domain.ResponseDTO; import net.lab1024.sa.base.common.util.SmartIpUtil; import net.lab1024.sa.base.common.util.SmartRequestUtil; import net.lab1024.sa.base.module.support.operatelog.OperateLogDao; @@ -46,7 +47,7 @@ import java.util.concurrent.ThreadPoolExecutor; * @Date 2021-12-08 20:48:52 * @Wechat zhuoda1024 * @Email lab1024@163.com - * @Copyright 1024创新实验室 + * @Copyright 1024创新实验室 */ @Slf4j @Aspect @@ -71,14 +72,14 @@ public abstract class OperateLogAspect { public void logPointCut() { } - @AfterReturning(pointcut = "logPointCut()") - public void doAfterReturning(JoinPoint joinPoint) { - handleLog(joinPoint, null); + @AfterReturning(pointcut = "logPointCut()", returning = "responseDTO") + public void doAfterReturning(JoinPoint joinPoint, Object responseDTO) { + handleLog(joinPoint, null, responseDTO); } @AfterThrowing(value = "logPointCut()", throwing = "e") public void doAfterThrowing(JoinPoint joinPoint, Exception e) { - handleLog(joinPoint, e); + handleLog(joinPoint, e, null); } /** @@ -109,16 +110,15 @@ public abstract class OperateLogAspect { taskExecutor.setWaitForTasksToCompleteOnShutdown(true); } - protected void handleLog(final JoinPoint joinPoint, final Exception e) { + protected void handleLog(final JoinPoint joinPoint, final Exception e, Object responseDTO) { try { OperateLog operateLog = this.getAnnotationLog(joinPoint); if (operateLog == null) { return; } - this.submitLog(joinPoint, e); + this.submitLog(joinPoint, e, responseDTO); } catch (Exception exp) { log.error("保存操作日志异常:{}", exp.getMessage()); - exp.printStackTrace(); } } @@ -173,11 +173,8 @@ public abstract class OperateLogAspect { /** * 提交存储操作日志 * - * @param joinPoint - * @param e - * @throws Exception */ - private void submitLog(final JoinPoint joinPoint, final Throwable e) throws Exception { + private void submitLog(final JoinPoint joinPoint, final Throwable e, Object responseDTO) { HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); //设置用户信息 RequestUser user = SmartRequestUtil.getRequestUser(); @@ -191,7 +188,7 @@ public abstract class OperateLogAspect { String methodName = joinPoint.getSignature().getName(); String operateMethod = className + "." + methodName; String failReason = null; - Boolean successFlag = true; + boolean successFlag = true; if (e != null) { successFlag = false; failReason = getExceptionString(e); @@ -210,15 +207,32 @@ public abstract class OperateLogAspect { .userAgent(user.getUserAgent()) .failReason(failReason) .successFlag(successFlag).build(); + Operation apiOperation = this.getApiOperation(joinPoint); if (apiOperation != null) { operateLogEntity.setContent(apiOperation.summary()); } + Tag api = this.getApi(joinPoint); if (api != null) { String name = api.name(); operateLogEntity.setModule(StrUtil.join(",", name)); } + + // 处理返回值 ResponseDTO + if(responseDTO instanceof ResponseDTO) { + ResponseDTO response = (ResponseDTO) responseDTO; + ResponseDTO logResponseDTO = new ResponseDTO( + response.getCode(), + response.getLevel(), + response.getOk(), + response.getMsg(), + null + ); + logResponseDTO.setDataType(response.getDataType()); + operateLogEntity.setResponse(JSON.toJSONString(logResponseDTO)); + } + taskExecutor.execute(() -> { this.saveLog(operateLogEntity); }); diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/domain/OperateLogEntity.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/domain/OperateLogEntity.java index 4f83b1dd..013d24d3 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/domain/OperateLogEntity.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/domain/OperateLogEntity.java @@ -71,6 +71,11 @@ public class OperateLogEntity { */ private String param; + /** + * 返回值 + */ + private String response; + /** * 客户ip */ diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/domain/OperateLogVO.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/domain/OperateLogVO.java index 9cf3529f..a6570980 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/domain/OperateLogVO.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/domain/OperateLogVO.java @@ -47,6 +47,9 @@ public class OperateLogVO { @Schema(description = "请求参数") private String param; + @Schema(description = "返回值") + private String response; + @Schema(description = "客户ip") private String ip; diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/code-generator-template/js/form.vue.vm b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/code-generator-template/js/form.vue.vm index 6291a44b..501bc432 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/code-generator-template/js/form.vue.vm +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/code-generator-template/js/form.vue.vm @@ -48,7 +48,7 @@ #end #if($field.frontComponent == "DictSelect") - + #end #if($field.frontComponent == "Date") @@ -106,7 +106,7 @@ #end #if($field.frontComponent == "DictSelect") - + #end #if($field.frontComponent == "Date") diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/code-generator-template/js/list.vue.vm b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/code-generator-template/js/list.vue.vm index e90d74d2..aecbbcbd 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/code-generator-template/js/list.vue.vm +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/code-generator-template/js/list.vue.vm @@ -22,7 +22,7 @@ #end #if($field.queryTypeEnum == "Dict") - + #end #if($field.queryTypeEnum == "Enum") diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/code-generator-template/ts/form.vue.vm b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/code-generator-template/ts/form.vue.vm index 6e21ce79..8438c913 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/code-generator-template/ts/form.vue.vm +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/code-generator-template/ts/form.vue.vm @@ -48,7 +48,7 @@ #end #if($field.frontComponent == "DictSelect") - + #end #if($field.frontComponent == "Date") @@ -106,7 +106,7 @@ #end #if($field.frontComponent == "DictSelect") - + #end #if($field.frontComponent == "Date") diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/code-generator-template/ts/list.vue.vm b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/code-generator-template/ts/list.vue.vm index 11747b09..1d55a2bf 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/code-generator-template/ts/list.vue.vm +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/code-generator-template/ts/list.vue.vm @@ -22,7 +22,7 @@ #end #if($field.queryTypeEnum == "Dict") - + #end #if($field.queryTypeEnum == "Enum") diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/mapper/support/OperateLogMapper.xml b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/mapper/support/OperateLogMapper.xml index d00adff0..ac987a64 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/resources/mapper/support/OperateLogMapper.xml +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/resources/mapper/support/OperateLogMapper.xml @@ -26,7 +26,7 @@ AND (INSTR(module,#{query.keywords}) OR INSTR(content,#{query.keywords})) - AND (INSTR(url,#{query.requestKeywords}) OR INSTR(method,#{query.requestKeywords}) OR INSTR(param,#{query.requestKeywords})) + AND (INSTR(url,#{query.requestKeywords}) OR INSTR(method,#{query.requestKeywords}) OR INSTR(param,#{query.requestKeywords}) OR INSTR(response,#{query.requestKeywords})) AND success_flag = #{query.successFlag} diff --git a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/interceptor/AdminInterceptor.java b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/interceptor/AdminInterceptor.java index fd323906..17c11b54 100644 --- a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/interceptor/AdminInterceptor.java +++ b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/interceptor/AdminInterceptor.java @@ -67,7 +67,7 @@ public class AdminInterceptor implements HandlerInterceptor { Method method = ((HandlerMethod) handler).getMethod(); NoNeedLogin noNeedLogin = ((HandlerMethod) handler).getMethodAnnotation(NoNeedLogin.class); if (noNeedLogin != null) { - checkActiveTimeout(requestEmployee); + updateActiveTimeout(requestEmployee); SmartRequestUtil.setRequestUser(requestEmployee); return true; } @@ -77,8 +77,8 @@ public class AdminInterceptor implements HandlerInterceptor { return false; } - // 检测token 活跃频率 - checkActiveTimeout(requestEmployee); + // 更新活跃 + updateActiveTimeout(requestEmployee); // --------------- 第三步: 校验 权限 --------------- @@ -123,15 +123,12 @@ public class AdminInterceptor implements HandlerInterceptor { /** - * 检测:token 最低活跃频率(单位:秒),如果 token 超过此时间没有访问系统就会被冻结 + * 更新活跃时间 */ - private void checkActiveTimeout(RequestEmployee requestEmployee) { - // 用户不在线,也不用检测 + private void updateActiveTimeout(RequestEmployee requestEmployee) { if (requestEmployee == null) { return; } - - StpUtil.checkActiveTimeout(); StpUtil.updateLastActiveToNow(); } diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/config/FileConfig.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/config/FileConfig.java index 98eb03fe..97dce114 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/config/FileConfig.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/config/FileConfig.java @@ -81,7 +81,7 @@ public class FileConfig implements WebMvcConfigurer { StaticCredentialsProvider.create( AwsBasicCredentials.create(accessKey, secretKey))) .serviceConfiguration(S3Configuration.builder() - .pathStyleAccessEnabled(false) + .pathStyleAccessEnabled(true) .chunkedEncodingEnabled(false) .build()) .build(); diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/file/service/FileStorageCloudServiceImpl.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/file/service/FileStorageCloudServiceImpl.java index 0493a4db..99849a95 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/file/service/FileStorageCloudServiceImpl.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/file/service/FileStorageCloudServiceImpl.java @@ -106,7 +106,18 @@ public class FileStorageCloudServiceImpl implements IFileStorageService { userMetadata.put(USER_METADATA_FILE_FORMAT, fileType); userMetadata.put(USER_METADATA_FILE_SIZE, String.valueOf(file.getSize())); - PutObjectRequest putObjectRequest = PutObjectRequest.builder().bucket(cloudConfig.getBucketName()).key(fileKey).metadata(userMetadata).contentLength(file.getSize()).contentType(this.getContentType(fileType)).contentEncoding(StandardCharsets.UTF_8.name()).contentDisposition("attachment;filename=" + urlEncoderFilename).build(); + // 根据文件路径获取并设置访问权限 + ObjectCannedACL acl = this.getACL(path); + PutObjectRequest putObjectRequest = PutObjectRequest.builder() + .bucket(cloudConfig.getBucketName()) + .key(fileKey) + .metadata(userMetadata) + .contentLength(file.getSize()) + .contentType(this.getContentType(fileType)) + .contentEncoding(StandardCharsets.UTF_8.name()) + .contentDisposition("attachment;filename=" + urlEncoderFilename) + .acl(acl) + .build(); InputStream inputStream = null; try { inputStream = file.getInputStream(); @@ -117,10 +128,6 @@ public class FileStorageCloudServiceImpl implements IFileStorageService { } finally { IOUtils.closeQuietly(inputStream); } - // 根据文件路径获取并设置访问权限 - ObjectCannedACL acl = this.getACL(path); - PutObjectAclRequest aclRequest = PutObjectAclRequest.builder().bucket(cloudConfig.getBucketName()).key(fileKey).acl(this.getACL(path)).build(); - s3Client.putObjectAcl(aclRequest); // 返回上传结果 FileUploadVO uploadVO = new FileUploadVO(); uploadVO.setFileName(originalFileName); diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/core/OperateLogAspect.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/core/OperateLogAspect.java index 4618fcf7..dd723bac 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/core/OperateLogAspect.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/core/OperateLogAspect.java @@ -3,11 +3,12 @@ package net.lab1024.sa.base.module.support.operatelog.core; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.extern.slf4j.Slf4j; import net.lab1024.sa.base.common.constant.StringConst; import net.lab1024.sa.base.common.domain.RequestUser; +import net.lab1024.sa.base.common.domain.ResponseDTO; import net.lab1024.sa.base.common.util.SmartIpUtil; import net.lab1024.sa.base.common.util.SmartRequestUtil; import net.lab1024.sa.base.module.support.operatelog.OperateLogDao; @@ -20,7 +21,6 @@ import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.reflect.MethodSignature; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.bind.BindResult; import org.springframework.context.ApplicationContext; import org.springframework.core.annotation.AnnotationUtils; @@ -36,7 +36,6 @@ import javax.servlet.http.HttpServletResponse; import java.io.PrintWriter; import java.io.StringWriter; import java.lang.reflect.Method; -import java.net.BindException; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ThreadPoolExecutor; @@ -48,7 +47,7 @@ import java.util.concurrent.ThreadPoolExecutor; * @Date 2021-12-08 20:48:52 * @Wechat zhuoda1024 * @Email lab1024@163.com - * @Copyright 1024创新实验室 + * @Copyright 1024创新实验室 */ @Slf4j @Aspect @@ -73,14 +72,14 @@ public abstract class OperateLogAspect { public void logPointCut() { } - @AfterReturning(pointcut = "logPointCut()") - public void doAfterReturning(JoinPoint joinPoint) { - handleLog(joinPoint, null); + @AfterReturning(pointcut = "logPointCut()", returning = "responseDTO") + public void doAfterReturning(JoinPoint joinPoint, Object responseDTO) { + handleLog(joinPoint, null, responseDTO); } @AfterThrowing(value = "logPointCut()", throwing = "e") public void doAfterThrowing(JoinPoint joinPoint, Exception e) { - handleLog(joinPoint, e); + handleLog(joinPoint, e, null); } /** @@ -111,16 +110,15 @@ public abstract class OperateLogAspect { taskExecutor.setWaitForTasksToCompleteOnShutdown(true); } - protected void handleLog(final JoinPoint joinPoint, final Exception e) { + protected void handleLog(final JoinPoint joinPoint, final Exception e, Object responseDTO) { try { OperateLog operateLog = this.getAnnotationLog(joinPoint); if (operateLog == null) { return; } - this.submitLog(joinPoint, e); + this.submitLog(joinPoint, e, responseDTO); } catch (Exception exp) { log.error("保存操作日志异常:{}", exp.getMessage()); - exp.printStackTrace(); } } @@ -175,11 +173,8 @@ public abstract class OperateLogAspect { /** * 提交存储操作日志 * - * @param joinPoint - * @param e - * @throws Exception */ - private void submitLog(final JoinPoint joinPoint, final Throwable e) throws Exception { + private void submitLog(final JoinPoint joinPoint, final Throwable e, Object responseDTO) { HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); //设置用户信息 RequestUser user = SmartRequestUtil.getRequestUser(); @@ -193,7 +188,7 @@ public abstract class OperateLogAspect { String methodName = joinPoint.getSignature().getName(); String operateMethod = className + "." + methodName; String failReason = null; - Boolean successFlag = true; + boolean successFlag = true; if (e != null) { successFlag = false; failReason = getExceptionString(e); @@ -212,15 +207,32 @@ public abstract class OperateLogAspect { .userAgent(user.getUserAgent()) .failReason(failReason) .successFlag(successFlag).build(); + Operation apiOperation = this.getApiOperation(joinPoint); if (apiOperation != null) { operateLogEntity.setContent(apiOperation.summary()); } + Tag api = this.getApi(joinPoint); if (api != null) { String name = api.name(); operateLogEntity.setModule(StrUtil.join(",", name)); } + + // 处理返回值 ResponseDTO + if(responseDTO instanceof ResponseDTO) { + ResponseDTO response = (ResponseDTO) responseDTO; + ResponseDTO logResponseDTO = new ResponseDTO( + response.getCode(), + response.getLevel(), + response.getOk(), + response.getMsg(), + null + ); + logResponseDTO.setDataType(response.getDataType()); + operateLogEntity.setResponse(JSON.toJSONString(logResponseDTO)); + } + taskExecutor.execute(() -> { this.saveLog(operateLogEntity); }); diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/domain/OperateLogEntity.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/domain/OperateLogEntity.java index 4f83b1dd..013d24d3 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/domain/OperateLogEntity.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/domain/OperateLogEntity.java @@ -71,6 +71,11 @@ public class OperateLogEntity { */ private String param; + /** + * 返回值 + */ + private String response; + /** * 客户ip */ diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/domain/OperateLogVO.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/domain/OperateLogVO.java index 9cf3529f..a6570980 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/domain/OperateLogVO.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/operatelog/domain/OperateLogVO.java @@ -47,6 +47,9 @@ public class OperateLogVO { @Schema(description = "请求参数") private String param; + @Schema(description = "返回值") + private String response; + @Schema(description = "客户ip") private String ip; diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/resources/code-generator-template/js/form.vue.vm b/smart-admin-api-java8-springboot2/sa-base/src/main/resources/code-generator-template/js/form.vue.vm index 6291a44b..501bc432 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/resources/code-generator-template/js/form.vue.vm +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/resources/code-generator-template/js/form.vue.vm @@ -48,7 +48,7 @@ #end #if($field.frontComponent == "DictSelect") - + #end #if($field.frontComponent == "Date") @@ -106,7 +106,7 @@ #end #if($field.frontComponent == "DictSelect") - + #end #if($field.frontComponent == "Date") diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/resources/code-generator-template/js/list.vue.vm b/smart-admin-api-java8-springboot2/sa-base/src/main/resources/code-generator-template/js/list.vue.vm index e90d74d2..aecbbcbd 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/resources/code-generator-template/js/list.vue.vm +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/resources/code-generator-template/js/list.vue.vm @@ -22,7 +22,7 @@ #end #if($field.queryTypeEnum == "Dict") - + #end #if($field.queryTypeEnum == "Enum") diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/resources/code-generator-template/ts/form.vue.vm b/smart-admin-api-java8-springboot2/sa-base/src/main/resources/code-generator-template/ts/form.vue.vm index 6e21ce79..8438c913 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/resources/code-generator-template/ts/form.vue.vm +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/resources/code-generator-template/ts/form.vue.vm @@ -48,7 +48,7 @@ #end #if($field.frontComponent == "DictSelect") - + #end #if($field.frontComponent == "Date") @@ -106,7 +106,7 @@ #end #if($field.frontComponent == "DictSelect") - + #end #if($field.frontComponent == "Date") diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/resources/code-generator-template/ts/list.vue.vm b/smart-admin-api-java8-springboot2/sa-base/src/main/resources/code-generator-template/ts/list.vue.vm index 11747b09..1d55a2bf 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/resources/code-generator-template/ts/list.vue.vm +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/resources/code-generator-template/ts/list.vue.vm @@ -22,7 +22,7 @@ #end #if($field.queryTypeEnum == "Dict") - + #end #if($field.queryTypeEnum == "Enum") diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/resources/mapper/support/OperateLogMapper.xml b/smart-admin-api-java8-springboot2/sa-base/src/main/resources/mapper/support/OperateLogMapper.xml index d00adff0..ac987a64 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/resources/mapper/support/OperateLogMapper.xml +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/resources/mapper/support/OperateLogMapper.xml @@ -26,7 +26,7 @@ AND (INSTR(module,#{query.keywords}) OR INSTR(content,#{query.keywords})) - AND (INSTR(url,#{query.requestKeywords}) OR INSTR(method,#{query.requestKeywords}) OR INSTR(param,#{query.requestKeywords})) + AND (INSTR(url,#{query.requestKeywords}) OR INSTR(method,#{query.requestKeywords}) OR INSTR(param,#{query.requestKeywords}) OR INSTR(response,#{query.requestKeywords})) AND success_flag = #{query.successFlag} diff --git a/smart-admin-web-javascript/package.json b/smart-admin-web-javascript/package.json index 706d9298..a4a1a217 100644 --- a/smart-admin-web-javascript/package.json +++ b/smart-admin-web-javascript/package.json @@ -43,7 +43,7 @@ "vue": "3.4.27", "vue-i18n": "9.13.1", "vue-router": "4.3.2", - "vue3-json-viewer": "2.2.2" + "vue3-json-viewer": "2.3.1" }, "devDependencies": { "@vitejs/plugin-vue": "5.0.4", diff --git a/smart-admin-web-javascript/src/components/support/data-tracer/index.vue b/smart-admin-web-javascript/src/components/support/data-tracer/index.vue index d8072275..8a8ae907 100644 --- a/smart-admin-web-javascript/src/components/support/data-tracer/index.vue +++ b/smart-admin-web-javascript/src/components/support/data-tracer/index.vue @@ -51,7 +51,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="ajaxQuery" - @showSizeChange="ajaxQuery" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/components/system/employee-table-select-modal/index.vue b/smart-admin-web-javascript/src/components/system/employee-table-select-modal/index.vue index b68dfc32..83ddb407 100644 --- a/smart-admin-web-javascript/src/components/system/employee-table-select-modal/index.vue +++ b/smart-admin-web-javascript/src/components/system/employee-table-select-modal/index.vue @@ -71,7 +71,6 @@ v-model:pageSize="params.pageSize" :total="total" @change="queryEmployee" - @showSizeChange="queryEmployee" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/config/app-config.js b/smart-admin-web-javascript/src/config/app-config.js index d9dad8a1..aae5e201 100644 --- a/smart-admin-web-javascript/src/config/app-config.js +++ b/smart-admin-web-javascript/src/config/app-config.js @@ -27,7 +27,7 @@ export const appDefaultConfig = { // 圆角 borderRadius: 6, // 菜单展开模式 - flatPattern: false, + menuSingleExpandFlag: true, // 标签页 pageTagFlag: true, // 标签页样式: default、 antd、chrome diff --git a/smart-admin-web-javascript/src/i18n/lang/en-US/index.js b/smart-admin-web-javascript/src/i18n/lang/en-US/index.js index bbe64914..7027441a 100644 --- a/smart-admin-web-javascript/src/i18n/lang/en-US/index.js +++ b/smart-admin-web-javascript/src/i18n/lang/en-US/index.js @@ -21,11 +21,11 @@ export default { 'setting.menu.layout': 'Menu Layout', 'setting.menu.width': 'Menu Width', 'setting.menu.theme': 'Menu Theme', + 'setting.menu.expand': 'Menu Expand', 'setting.page.width': 'Page Width', 'setting.border.radius': 'Border Radius', 'setting.compact': 'Page Compact', 'setting.bread': 'Show Bread', - 'setting.flatPattern': 'Flat Pattern', 'setting.pagetag': 'Show PageTag', 'setting.pagetag.style': 'PageTag Style', 'setting.footer': 'Show Footer', diff --git a/smart-admin-web-javascript/src/i18n/lang/zh-CN/index.js b/smart-admin-web-javascript/src/i18n/lang/zh-CN/index.js index 29e5b74d..05040526 100644 --- a/smart-admin-web-javascript/src/i18n/lang/zh-CN/index.js +++ b/smart-admin-web-javascript/src/i18n/lang/zh-CN/index.js @@ -21,11 +21,11 @@ export default { 'setting.menu.layout': '菜单布局', 'setting.menu.width': '菜单宽度', 'setting.menu.theme': '菜单主题', + 'setting.menu.expand': '菜单展开', 'setting.compact': '页面紧凑', 'setting.border.radius': '页面圆角', 'setting.page.width': '页面宽度', 'setting.bread': '面包屑', - 'setting.flatPattern': '菜单展开模式', 'setting.pagetag': '标签页', 'setting.pagetag.style': '标签页样式', 'setting.footer': '页脚', diff --git a/smart-admin-web-javascript/src/layout/components/header-user-space/header-setting.vue b/smart-admin-web-javascript/src/layout/components/header-user-space/header-setting.vue index eaf1b9e5..ba0c0d29 100644 --- a/smart-admin-web-javascript/src/layout/components/header-user-space/header-setting.vue +++ b/smart-admin-web-javascript/src/layout/components/header-user-space/header-setting.vue @@ -83,8 +83,8 @@ Chrome - - + + @@ -213,8 +213,8 @@ borderRadius: appConfigStore.borderRadius, // 标签页 pageTagFlag: appConfigStore.pageTagFlag, - // 标签页 - flatPattern: appConfigStore.flatPattern, + // 菜单展开方式 + menuSingleExpandFlag: appConfigStore.menuSingleExpandFlag, // 标签页 样式 pageTagStyle: appConfigStore.pageTagStyle, // 面包屑 @@ -303,9 +303,9 @@ }); } - function changeFlatPattern(e) { + function changeMenuExpandFlag(e) { appConfigStore.$patch({ - flatPattern: e, + menuSingleExpandFlag: e, }); } diff --git a/smart-admin-web-javascript/src/layout/components/side-menu/recursion-menu.vue b/smart-admin-web-javascript/src/layout/components/side-menu/recursion-menu.vue index af9c1ad1..6977a257 100644 --- a/smart-admin-web-javascript/src/layout/components/side-menu/recursion-menu.vue +++ b/smart-admin-web-javascript/src/layout/components/side-menu/recursion-menu.vue @@ -36,7 +36,7 @@ import { useUserStore } from '/@/store/modules/system/user'; const theme = computed(() => useAppConfigStore().$state.sideMenuTheme); - const flatPattern = computed(() => useAppConfigStore().$state.flatPattern); + const menuSingleExpandFlag = computed(() => useAppConfigStore().$state.menuSingleExpandFlag); const props = defineProps({ collapsed: { @@ -46,8 +46,7 @@ }); const menuTree = computed(() => useUserStore().getMenuTree || []); - const rootSubmenuKeys = computed(()=>menuTree.value.map(item=>item.menuId)); - + const rootSubmenuKeys = computed(() => menuTree.value.map((item) => item.menuId)); //展开的菜单 let currentRoute = useRoute(); @@ -76,9 +75,15 @@ let parentList = menuParentIdListMap.get(currentRoute.name) || []; // 如果是折叠菜单的话,则不需要设置openkey - if (!props.collapsed) { + if (props.collapsed) { + return; + } + + let needOpenKeys = _.map(parentList, 'name').map(Number); + if (menuSingleExpandFlag.value) { + openKeys.value = [...needOpenKeys]; + } else { // 使用lodash的union函数,进行 去重合并两个数组 - let needOpenKeys = _.map(parentList, 'name').map(Number); openKeys.value = _.union(openKeys.value, needOpenKeys); } } @@ -92,17 +97,18 @@ immediate: true, } ); - function onOpenChange(openKeysParams){ - if(flatPattern.value){ - return; + + function onOpenChange(openKeysParams) { + if (!menuSingleExpandFlag.value) { + return; + } + const latestOpenKey = openKeysParams.find((key) => openKeys.value.indexOf(key) === -1); + if (rootSubmenuKeys.value.indexOf(latestOpenKey) === -1) { + openKeys.value = openKeysParams; + } else { + openKeys.value = latestOpenKey ? [latestOpenKey] : []; + } } - const latestOpenKey = openKeysParams.find(key => openKeys.value.indexOf(key) === -1); - if (rootSubmenuKeys.value.indexOf(latestOpenKey) === -1) { - openKeys.value = openKeysParams; - } else { - openKeys.value = latestOpenKey ? [latestOpenKey] : []; - } -}; defineExpose({ updateOpenKeysAndSelectKeys, }); diff --git a/smart-admin-web-javascript/src/views/business/erp/goods/goods-list.vue b/smart-admin-web-javascript/src/views/business/erp/goods/goods-list.vue index c4be7333..f5d2e69e 100644 --- a/smart-admin-web-javascript/src/views/business/erp/goods/goods-list.vue +++ b/smart-admin-web-javascript/src/views/business/erp/goods/goods-list.vue @@ -149,7 +149,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="queryData" - @showSizeChange="queryData" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/business/oa/enterprise/components/enterprise-bank-list.vue b/smart-admin-web-javascript/src/views/business/oa/enterprise/components/enterprise-bank-list.vue index 283bd81e..f98b9171 100644 --- a/smart-admin-web-javascript/src/views/business/oa/enterprise/components/enterprise-bank-list.vue +++ b/smart-admin-web-javascript/src/views/business/oa/enterprise/components/enterprise-bank-list.vue @@ -78,7 +78,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="ajaxQuery" - @showSizeChange="ajaxQuery" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/business/oa/enterprise/components/enterprise-employee-list.vue b/smart-admin-web-javascript/src/views/business/oa/enterprise/components/enterprise-employee-list.vue index d238a363..a1605da7 100644 --- a/smart-admin-web-javascript/src/views/business/oa/enterprise/components/enterprise-employee-list.vue +++ b/smart-admin-web-javascript/src/views/business/oa/enterprise/components/enterprise-employee-list.vue @@ -63,7 +63,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="queryEmployee" - @showSizeChange="queryEmployee" :show-total="showTableTotal" /> diff --git a/smart-admin-web-javascript/src/views/business/oa/enterprise/components/enterprise-invoice-list.vue b/smart-admin-web-javascript/src/views/business/oa/enterprise/components/enterprise-invoice-list.vue index b2e60293..42e07555 100644 --- a/smart-admin-web-javascript/src/views/business/oa/enterprise/components/enterprise-invoice-list.vue +++ b/smart-admin-web-javascript/src/views/business/oa/enterprise/components/enterprise-invoice-list.vue @@ -75,7 +75,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="ajaxQuery" - @showSizeChange="ajaxQuery" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/business/oa/enterprise/enterprise-list.vue b/smart-admin-web-javascript/src/views/business/oa/enterprise/enterprise-list.vue index c945ca4b..98aec1a0 100644 --- a/smart-admin-web-javascript/src/views/business/oa/enterprise/enterprise-list.vue +++ b/smart-admin-web-javascript/src/views/business/oa/enterprise/enterprise-list.vue @@ -102,7 +102,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="ajaxQuery" - @showSizeChange="ajaxQuery" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/business/oa/notice/components/notice-view-record-list.vue b/smart-admin-web-javascript/src/views/business/oa/notice/components/notice-view-record-list.vue index de4eb520..9b33bc8e 100644 --- a/smart-admin-web-javascript/src/views/business/oa/notice/components/notice-view-record-list.vue +++ b/smart-admin-web-javascript/src/views/business/oa/notice/components/notice-view-record-list.vue @@ -53,7 +53,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="queryViewRecord" - @showSizeChange="queryViewRecord" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/business/oa/notice/notice-employee-list.vue b/smart-admin-web-javascript/src/views/business/oa/notice/notice-employee-list.vue index 2749e2e9..5702a3db 100644 --- a/smart-admin-web-javascript/src/views/business/oa/notice/notice-employee-list.vue +++ b/smart-admin-web-javascript/src/views/business/oa/notice/notice-employee-list.vue @@ -72,7 +72,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="queryNoticeList" - @showSizeChange="queryNoticeList" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/business/oa/notice/notice-list.vue b/smart-admin-web-javascript/src/views/business/oa/notice/notice-list.vue index 0c70b682..b11036fc 100644 --- a/smart-admin-web-javascript/src/views/business/oa/notice/notice-list.vue +++ b/smart-admin-web-javascript/src/views/business/oa/notice/notice-list.vue @@ -122,7 +122,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="queryNoticeList" - @showSizeChange="queryNoticeList" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/support/change-log/change-log-list.vue b/smart-admin-web-javascript/src/views/support/change-log/change-log-list.vue index 0c5c8e61..536999f6 100644 --- a/smart-admin-web-javascript/src/views/support/change-log/change-log-list.vue +++ b/smart-admin-web-javascript/src/views/support/change-log/change-log-list.vue @@ -107,7 +107,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="queryData" - @showSizeChange="queryData" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/support/code-generator/code-generator-list.vue b/smart-admin-web-javascript/src/views/support/code-generator/code-generator-list.vue index 8e77b5b8..2f0c6dbe 100644 --- a/smart-admin-web-javascript/src/views/support/code-generator/code-generator-list.vue +++ b/smart-admin-web-javascript/src/views/support/code-generator/code-generator-list.vue @@ -74,7 +74,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="ajaxQuery" - @showSizeChange="ajaxQuery" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/support/config/config-list.vue b/smart-admin-web-javascript/src/views/support/config/config-list.vue index 9ae44622..eb81f6a7 100644 --- a/smart-admin-web-javascript/src/views/support/config/config-list.vue +++ b/smart-admin-web-javascript/src/views/support/config/config-list.vue @@ -66,7 +66,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="ajaxQuery" - @showSizeChange="ajaxQuery" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/support/dict/index.vue b/smart-admin-web-javascript/src/views/support/dict/index.vue index a215547a..ebab7457 100644 --- a/smart-admin-web-javascript/src/views/support/dict/index.vue +++ b/smart-admin-web-javascript/src/views/support/dict/index.vue @@ -98,7 +98,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="ajaxQuery" - @showSizeChange="ajaxQuery" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/support/feedback/feedback-list.vue b/smart-admin-web-javascript/src/views/support/feedback/feedback-list.vue index 5884cffb..fe6fcfb5 100644 --- a/smart-admin-web-javascript/src/views/support/feedback/feedback-list.vue +++ b/smart-admin-web-javascript/src/views/support/feedback/feedback-list.vue @@ -64,7 +64,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="queryList" - @showSizeChange="queryList" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/support/file/file-list.vue b/smart-admin-web-javascript/src/views/support/file/file-list.vue index 1a5fe4fb..ce8cdbf9 100644 --- a/smart-admin-web-javascript/src/views/support/file/file-list.vue +++ b/smart-admin-web-javascript/src/views/support/file/file-list.vue @@ -103,7 +103,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="queryData" - @showSizeChange="queryData" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/support/heart-beat/heart-beat-list.vue b/smart-admin-web-javascript/src/views/support/heart-beat/heart-beat-list.vue index f789afca..4c7ffcbf 100644 --- a/smart-admin-web-javascript/src/views/support/heart-beat/heart-beat-list.vue +++ b/smart-admin-web-javascript/src/views/support/heart-beat/heart-beat-list.vue @@ -79,7 +79,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="ajaxQuery" - @showSizeChange="ajaxQuery" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/support/help-doc/management/components/help-doc-list.vue b/smart-admin-web-javascript/src/views/support/help-doc/management/components/help-doc-list.vue index 2d3168ed..b83dd675 100644 --- a/smart-admin-web-javascript/src/views/support/help-doc/management/components/help-doc-list.vue +++ b/smart-admin-web-javascript/src/views/support/help-doc/management/components/help-doc-list.vue @@ -88,7 +88,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="queryHelpDocList" - @showSizeChange="queryHelpDocList" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/support/help-doc/user-view/components/help-doc-view-record-list.vue b/smart-admin-web-javascript/src/views/support/help-doc/user-view/components/help-doc-view-record-list.vue index 63a90da1..faac882c 100644 --- a/smart-admin-web-javascript/src/views/support/help-doc/user-view/components/help-doc-view-record-list.vue +++ b/smart-admin-web-javascript/src/views/support/help-doc/user-view/components/help-doc-view-record-list.vue @@ -49,7 +49,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="queryViewRecord" - @showSizeChange="queryViewRecord" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/support/job/components/deleted-job-list.vue b/smart-admin-web-javascript/src/views/support/job/components/deleted-job-list.vue index 6cac4561..a2a20344 100644 --- a/smart-admin-web-javascript/src/views/support/job/components/deleted-job-list.vue +++ b/smart-admin-web-javascript/src/views/support/job/components/deleted-job-list.vue @@ -117,7 +117,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="queryJobList" - @showSizeChange="queryJobList" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/support/job/components/job-log-list-modal.vue b/smart-admin-web-javascript/src/views/support/job/components/job-log-list-modal.vue index 07abf0fa..5c42c1a5 100644 --- a/smart-admin-web-javascript/src/views/support/job/components/job-log-list-modal.vue +++ b/smart-admin-web-javascript/src/views/support/job/components/job-log-list-modal.vue @@ -71,7 +71,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="queryLogList" - @showSizeChange="queryLogList" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/support/job/job-list.vue b/smart-admin-web-javascript/src/views/support/job/job-list.vue index 66ce2df8..54df6a54 100644 --- a/smart-admin-web-javascript/src/views/support/job/job-list.vue +++ b/smart-admin-web-javascript/src/views/support/job/job-list.vue @@ -136,7 +136,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="queryJobList" - @showSizeChange="queryJobList" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/support/login-fail/login-fail-list.vue b/smart-admin-web-javascript/src/views/support/login-fail/login-fail-list.vue index 405ea458..70e308f0 100644 --- a/smart-admin-web-javascript/src/views/support/login-fail/login-fail-list.vue +++ b/smart-admin-web-javascript/src/views/support/login-fail/login-fail-list.vue @@ -102,7 +102,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="onSearch" - @showSizeChange="onSearch" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/support/login-log/login-log-list.vue b/smart-admin-web-javascript/src/views/support/login-log/login-log-list.vue index fd938c85..d21b436d 100644 --- a/smart-admin-web-javascript/src/views/support/login-log/login-log-list.vue +++ b/smart-admin-web-javascript/src/views/support/login-log/login-log-list.vue @@ -89,7 +89,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="ajaxQuery" - @showSizeChange="ajaxQuery" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/support/message/components/message-receiver-modal.vue b/smart-admin-web-javascript/src/views/support/message/components/message-receiver-modal.vue index 1190878e..c89e8f9d 100644 --- a/smart-admin-web-javascript/src/views/support/message/components/message-receiver-modal.vue +++ b/smart-admin-web-javascript/src/views/support/message/components/message-receiver-modal.vue @@ -47,7 +47,6 @@ v-model:pageSize="queryParam.pageSize" :total="total" @change="queryList" - @showSizeChange="queryList" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/support/message/message-list.vue b/smart-admin-web-javascript/src/views/support/message/message-list.vue index 048a005e..321189c8 100644 --- a/smart-admin-web-javascript/src/views/support/message/message-list.vue +++ b/smart-admin-web-javascript/src/views/support/message/message-list.vue @@ -78,7 +78,6 @@ v-model:pageSize="queryForm.pageSize" :total="total" @change="queryData" - @showSizeChange="queryData" :show-total="(total) => `共${total}条`" /> diff --git a/smart-admin-web-javascript/src/views/support/operate-log/operate-log-detail-modal.vue b/smart-admin-web-javascript/src/views/support/operate-log/operate-log-detail-modal.vue index 7ceeb6e0..ad9ff5cb 100644 --- a/smart-admin-web-javascript/src/views/support/operate-log/operate-log-detail-modal.vue +++ b/smart-admin-web-javascript/src/views/support/operate-log/operate-log-detail-modal.vue @@ -12,6 +12,10 @@
+ + 用户id:{{ detail.operateUserId }} + 用户名称: {{ detail.operateUserName }} + 请求url: {{ detail.url }} 请求日期: {{ detail.createTime }} @@ -21,8 +25,7 @@ IP地区: {{ detail.ipRegion }} - 用户id:{{ detail.operateUserId }} - 用户名称: {{ detail.operateUserName }} + 客户端: {{ detail.os }} / {{ detail.browser }} {{ detail.device ? '/' + detail.device : detail.device }} @@ -32,21 +35,26 @@ -
-
-

请求明细:

- 方法: {{ detail.method }} - 说明: {{ detail.module }} - {{ detail.content }} + + 方法: {{ detail.method }} + + + 说明: {{ detail.module }} - {{ detail.content }} +

请求参数:

- + +
+
+

返回结果:

+

请求失败原因:

-
+ {{ detail.failReason }} -
+
@@ -57,6 +65,7 @@ import { operateLogApi } from '/@/api/support/operate-log-api'; import { smartSentry } from '/@/lib/smart-sentry'; import { SmartLoading } from '/@/components/framework/smart-loading'; + import uaparser from 'ua-parser-js'; defineExpose({ show, @@ -87,11 +96,16 @@ param: '', url: '', }); + async function getDetail(operateLogId) { try { SmartLoading.show(); let res = await operateLogApi.detail(operateLogId); detail = Object.assign(detail, res.data); + let ua = uaparser(res.data.userAgent); + detail.browser = ua.browser.name; + detail.os = ua.os.name; + detail.device = ua.device.vendor ? ua.device.vendor + ua.device.model : ''; } catch (e) { smartSentry.captureError(e); } finally { @@ -107,10 +121,11 @@ font-size: 20px; font-weight: bold; } + .info-box { - border-bottom: 1px solid #f0f0f0; padding: 10px 8px; } + .detail-info { .ant-col { line-height: 1.46; @@ -118,6 +133,7 @@ padding-right: 5px; } } + .detail-right-title { text-align: right; color: grey; diff --git a/smart-admin-web-javascript/src/views/support/operate-log/operate-log-list.vue b/smart-admin-web-javascript/src/views/support/operate-log/operate-log-list.vue index c34d4f77..8afe7350 100644 --- a/smart-admin-web-javascript/src/views/support/operate-log/operate-log-list.vue +++ b/smart-admin-web-javascript/src/views/support/operate-log/operate-log-list.vue @@ -14,7 +14,7 @@ - + @@ -24,7 +24,7 @@ - + 全部 成功 @@ -51,18 +51,23 @@ - +