perf: TieshengWebConfigurer调整
This commit is contained in:
@@ -74,7 +74,10 @@ public class SpringExceptionHandler {
|
|||||||
return ApiResp.respCust(ApiRespEnum.ServerError.getCode(), "IO异常");
|
return ApiResp.respCust(ApiRespEnum.ServerError.getCode(), "IO异常");
|
||||||
}
|
}
|
||||||
|
|
||||||
return tieshengWebConfigurer.addExceptionHandler(e);
|
if (tieshengWebConfigurer != null) {
|
||||||
|
return tieshengWebConfigurer.addExceptionHandler(e);
|
||||||
|
}
|
||||||
|
return ApiResp.respCust(ApiRespEnum.ServerError);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,9 @@ package com.tiesheng.core.service;
|
|||||||
|
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.tiesheng.core.config.web.bean.CurrentWebUser;
|
import com.tiesheng.core.config.token.TokenParse;
|
||||||
import com.tiesheng.core.config.web.TieshengWebConfigurer;
|
import com.tiesheng.core.config.web.TieshengWebConfigurer;
|
||||||
|
import com.tiesheng.core.config.web.bean.CurrentWebUser;
|
||||||
import com.tiesheng.core.mapper.CoreLogOperationMapper;
|
import com.tiesheng.core.mapper.CoreLogOperationMapper;
|
||||||
import com.tiesheng.core.pojos.dao.CoreLogOperation;
|
import com.tiesheng.core.pojos.dao.CoreLogOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -28,9 +29,13 @@ public class CoreLogService extends ServiceImpl<CoreLogOperationMapper, CoreLogO
|
|||||||
*/
|
*/
|
||||||
public void addOperationLog(String title, String subject, Object params) {
|
public void addOperationLog(String title, String subject, Object params) {
|
||||||
CoreLogOperation operation = new CoreLogOperation();
|
CoreLogOperation operation = new CoreLogOperation();
|
||||||
CurrentWebUser currentWebUser = tieshengWebConfigurer.getCurrentUserName();
|
if (tieshengWebConfigurer != null) {
|
||||||
operation.setUserId(currentWebUser.getId());
|
CurrentWebUser currentWebUser = tieshengWebConfigurer.getCurrentUserName();
|
||||||
operation.setUserName(currentWebUser.getName());
|
operation.setUserId(currentWebUser.getId());
|
||||||
|
operation.setUserName(currentWebUser.getName());
|
||||||
|
} else {
|
||||||
|
operation.setUserId(TokenParse.getWithoutThr().getId());
|
||||||
|
}
|
||||||
operation.setTitle(title);
|
operation.setTitle(title);
|
||||||
operation.setSubject(subject);
|
operation.setSubject(subject);
|
||||||
if (params != null) {
|
if (params != null) {
|
||||||
|
|||||||
@@ -38,8 +38,10 @@ public class FileUploadService {
|
|||||||
public String saveMultipartFile(MultipartFile file) {
|
public String saveMultipartFile(MultipartFile file) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
String fileType = FileTypeUtil.getType(file.getInputStream(), file.getOriginalFilename());
|
if (tieshengWebConfigurer != null) {
|
||||||
tieshengWebConfigurer.uploadFileCheck(fileType);
|
String fileType = FileTypeUtil.getType(file.getInputStream(), file.getOriginalFilename());
|
||||||
|
tieshengWebConfigurer.uploadFileCheck(fileType);
|
||||||
|
}
|
||||||
|
|
||||||
FileUploadPath filePath = FileUploadPath.random();
|
FileUploadPath filePath = FileUploadPath.random();
|
||||||
|
|
||||||
@@ -63,7 +65,9 @@ public class FileUploadService {
|
|||||||
* @param fileExt
|
* @param fileExt
|
||||||
*/
|
*/
|
||||||
public void chunkStart(String fileExt) {
|
public void chunkStart(String fileExt) {
|
||||||
tieshengWebConfigurer.uploadFileCheck(fileExt);
|
if (tieshengWebConfigurer != null) {
|
||||||
|
tieshengWebConfigurer.uploadFileCheck(fileExt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user