[Bug修复](master): Bug

修复些许Bug
master
土豆兄弟 3 years ago
parent 322f9593a7
commit 1fa2db32fe

@ -9,8 +9,8 @@ import org.springframework.stereotype.Component;
@Generated( @Generated(
value = "org.mapstruct.ap.MappingProcessor", value = "org.mapstruct.ap.MappingProcessor",
date = "2021-04-20T11:01:39+0800", date = "2021-04-24T00:12:04+0800",
comments = "version: 1.3.1.Final, compiler: javac, environment: Java 1.8.0_251 (Oracle Corporation)" comments = "version: 1.3.1.Final, compiler: javac, environment: Java 1.8.0_261 (Oracle Corporation)"
) )
@Component @Component
public class LogErrorMapperImpl implements LogErrorMapper { public class LogErrorMapperImpl implements LogErrorMapper {

@ -9,8 +9,8 @@ import org.springframework.stereotype.Component;
@Generated( @Generated(
value = "org.mapstruct.ap.MappingProcessor", value = "org.mapstruct.ap.MappingProcessor",
date = "2021-04-20T11:01:39+0800", date = "2021-04-24T00:12:04+0800",
comments = "version: 1.3.1.Final, compiler: javac, environment: Java 1.8.0_251 (Oracle Corporation)" comments = "version: 1.3.1.Final, compiler: javac, environment: Java 1.8.0_261 (Oracle Corporation)"
) )
@Component @Component
public class LogSmallMapperImpl implements LogSmallMapper { public class LogSmallMapperImpl implements LogSmallMapper {

@ -16,7 +16,7 @@ public class SysConst {
// Test相关的 - end // Test相关的 - end
public static final String REMOTE_TRANS_HOST = "127.0.0.1"; // 118.178.137.129 116.62.197.152 public static final String REMOTE_TRANS_HOST = "116.62.197.152"; // 118.178.137.129 116.62.197.152
public static final Integer REMOTE_TRANS_PORT = 22; public static final Integer REMOTE_TRANS_PORT = 22;
@ -30,7 +30,7 @@ public class SysConst {
public static final String REMOTE_TRANS_DIR_PATH = "/home/"; public static final String REMOTE_TRANS_DIR_PATH = "/home/";
// fixme 以后改成rpc调用的地址 // fixme 以后改成rpc调用的地址
public static final String REMOTE_UPDATE_ADDR = "http://127.0.0.1:8001/api/remoteRecord/remote/rec"; public static final String REMOTE_UPDATE_ADDR = "http://116.62.197.152:8000/api/remoteRecord/remote/rec";
// 测试内容临时定义 // 测试内容临时定义
public static final String TEST_USER_NAME = "测试用户"; public static final String TEST_USER_NAME = "测试用户";

@ -56,8 +56,8 @@ import static me.zhengjie.modules.uploadnew.consts.SysConstNew.*;
//import org.springframework.util.StringUtils; //import org.springframework.util.StringUtils;
/** /**
* @website https://el-admin.vip
* @author weizhongxi * @author weizhongxi
* @website https://el-admin.vip
* @date 2021-04-14 * @date 2021-04-14
**/ **/
@RestController @RestController
@ -135,16 +135,18 @@ public class TbUploadFileNewController {
// 记录日志 // 记录日志
log.info("TbUploadFileNewController:fileUpload | taskName=" + taskName + "===== isEcryptionNew=" + isEcryptionNew); log.info("TbUploadFileNewController:fileUpload | taskName=" + taskName + "===== isEcryptionNew=" + isEcryptionNew);
// 校验上传是否有文件 // 校验上传是否有文件
if (file== null ){ if (null == file) {
return new ResponseEntity<>(CommonResponse.createByError(ResponseCode.NO_FILE_INPUT), HttpStatus.OK); return new ResponseEntity<>(CommonResponse.createByError(ResponseCode.NO_FILE_INPUT), HttpStatus.OK);
} }
Integer isEcryption = 0;
int isEcryption = 1;
try { try {
isEcryption = Integer.parseInt(isEcryptionNew); isEcryption = Integer.parseInt(isEcryptionNew);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
log.error("TbUploadFileNewController|fileUpload 转换异常!!!!"); log.error("TbUploadFileNewController|fileUpload 转换异常!!!!");
throw new BadRequestException("转换异常!!!"); throw new BadRequestException("转换异常!!!");
} }
String name = file.getOriginalFilename(); String name = file.getOriginalFilename();
String keyName = ""; String keyName = "";
String token = ""; String token = "";
@ -154,13 +156,12 @@ public class TbUploadFileNewController {
for (Cookie cookie : cookies) { for (Cookie cookie : cookies) {
//获取cookie的名字 //获取cookie的名字
token = cookie.getValue(); token = cookie.getValue();
log.info("TbUploadFileNewController:fileUpload | token="+token); log.info("TbUploadFileNewController:fileUpload | token: {} ", token);
} }
} }
RedisParentDao redisParentDao = new RedisParentDao(); RedisParentDao redisParentDao = new RedisParentDao();
redisParentDao.setRedisTemplate(redisTemplate); redisParentDao.setRedisTemplate(redisTemplate);
keyName = token+TOKEN_NAME+name; String keyValue = redisParentDao.getValue(token + TOKEN_NAME + name);
String keyValue = redisParentDao.getValue(keyName);
//防止用户多次提交 //防止用户多次提交
if (keyValue != null) { if (keyValue != null) {
return new ResponseEntity<>(CommonResponse.createByError(ResponseCode.TASK_STAETING), HttpStatus.OK); return new ResponseEntity<>(CommonResponse.createByError(ResponseCode.TASK_STAETING), HttpStatus.OK);
@ -202,6 +203,7 @@ public class TbUploadFileNewController {
redisParentDao.remove(keyName); redisParentDao.remove(keyName);
return new ResponseEntity<>(CommonResponse.createBySuccess(ResponseCode.SUCCESS), HttpStatus.OK); return new ResponseEntity<>(CommonResponse.createBySuccess(ResponseCode.SUCCESS), HttpStatus.OK);
} }
@Log("上传并加密任务") @Log("上传并加密任务")
@ApiOperation("上传并加密任务") @ApiOperation("上传并加密任务")
@AnonymousAccess @AnonymousAccess

@ -4,7 +4,7 @@ spring:
druid: druid:
db-type: com.alibaba.druid.pool.DruidDataSource db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://localhost:3306/eladmin1?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false url: jdbc:log4jdbc:mysql://localhost:3306/eladmin-plat2?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
username: root username: root
password: root password: root
# 初始连接数 # 初始连接数

Loading…
Cancel
Save