perf: TieshengWebConfigurer调整
This commit is contained in:
@@ -74,7 +74,10 @@ public class SpringExceptionHandler {
|
||||
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 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.bean.CurrentWebUser;
|
||||
import com.tiesheng.core.mapper.CoreLogOperationMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogOperation;
|
||||
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) {
|
||||
CoreLogOperation operation = new CoreLogOperation();
|
||||
CurrentWebUser currentWebUser = tieshengWebConfigurer.getCurrentUserName();
|
||||
operation.setUserId(currentWebUser.getId());
|
||||
operation.setUserName(currentWebUser.getName());
|
||||
if (tieshengWebConfigurer != null) {
|
||||
CurrentWebUser currentWebUser = tieshengWebConfigurer.getCurrentUserName();
|
||||
operation.setUserId(currentWebUser.getId());
|
||||
operation.setUserName(currentWebUser.getName());
|
||||
} else {
|
||||
operation.setUserId(TokenParse.getWithoutThr().getId());
|
||||
}
|
||||
operation.setTitle(title);
|
||||
operation.setSubject(subject);
|
||||
if (params != null) {
|
||||
|
||||
@@ -38,8 +38,10 @@ public class FileUploadService {
|
||||
public String saveMultipartFile(MultipartFile file) {
|
||||
try {
|
||||
|
||||
String fileType = FileTypeUtil.getType(file.getInputStream(), file.getOriginalFilename());
|
||||
tieshengWebConfigurer.uploadFileCheck(fileType);
|
||||
if (tieshengWebConfigurer != null) {
|
||||
String fileType = FileTypeUtil.getType(file.getInputStream(), file.getOriginalFilename());
|
||||
tieshengWebConfigurer.uploadFileCheck(fileType);
|
||||
}
|
||||
|
||||
FileUploadPath filePath = FileUploadPath.random();
|
||||
|
||||
@@ -63,7 +65,9 @@ public class FileUploadService {
|
||||
* @param fileExt
|
||||
*/
|
||||
public void chunkStart(String fileExt) {
|
||||
tieshengWebConfigurer.uploadFileCheck(fileExt);
|
||||
if (tieshengWebConfigurer != null) {
|
||||
tieshengWebConfigurer.uploadFileCheck(fileExt);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user