diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/rest/TbTemplateController.java b/eladmin-system/src/main/java/me/zhengjie/modules/sms/rest/TbTemplateController.java index 014bb72..e3994e7 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/rest/TbTemplateController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/sms/rest/TbTemplateController.java @@ -106,7 +106,7 @@ public class TbTemplateController { @ApiOperation("接收短信内容和url") // @PreAuthorize("@el.check('taskRecord:list')") @PostMapping(value = "/getSmsInfo") - // @AnonymousAccess // fixme 需要测试完成后进行去除和使用上面的权限注解 + @AnonymousAccess // fixme 需要测试完成后进行去除和使用上面的权限注解 public ResponseEntity getSmsInfo(@RequestBody SendNewVo sendVo){ log.info("========== [TbTemplateController|getSmsInfo ========== SmsContent:"+sendVo.getSmsContent()+" LinkUrl:"+sendVo.getLinkUrl()); if (sendVo == null){ diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/sms/vo/SendNewVo.java b/eladmin-system/src/main/java/me/zhengjie/modules/sms/vo/SendNewVo.java index b59f236..fef266b 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/sms/vo/SendNewVo.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/sms/vo/SendNewVo.java @@ -7,8 +7,6 @@ import lombok.Data; public class SendNewVo { @ApiModelProperty("发送链接") private String linkUrl; - @ApiModelProperty("模板id") - private String sendMessage; @ApiModelProperty("短信内容") private String smsContent; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/rest/TbUploadFileNewController.java b/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/rest/TbUploadFileNewController.java index 09807b2..39f7f4a 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/rest/TbUploadFileNewController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/rest/TbUploadFileNewController.java @@ -137,12 +137,14 @@ public class TbUploadFileNewController { String token = ""; HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest; Cookie[] cookies = httpServletRequest.getCookies(); - for(Cookie cookie : cookies) { - //获取cookie的名字 - String cookieName = cookie.getName(); - token=cookie.getValue(); - System.out.println(cookieName); - System.out.println(cookieName+" : "+ cookie.getValue() ); + if (cookies != null){ + for(Cookie cookie : cookies) { + //获取cookie的名字 + String cookieName = cookie.getName(); + token=cookie.getValue(); + System.out.println(cookieName); + System.out.println(cookieName+" : "+ cookie.getValue() ); + } } keyName = token+"==="+name; Object keyValue = redisTemplate.opsForValue().get(keyName); diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/service/impl/TbUploadFileNewServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/service/impl/TbUploadFileNewServiceImpl.java index 275f434..4241f04 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/service/impl/TbUploadFileNewServiceImpl.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/service/impl/TbUploadFileNewServiceImpl.java @@ -176,7 +176,8 @@ public class TbUploadFileNewServiceImpl implements TbUploadFileNewService { try { if(nameStr.equals(".xlsx")||nameStr.equals(".xls")){ fileFormat = "excel文件"; - list = FileUtil.readLines(eachFilePath, "UTF-8"); + ExcelUtils excelUtils = new ExcelUtils(); + list = excelUtils.excelParseList(file.getInputStream()); }else if (nameStr.equals(".txt")){ fileFormat = "txt文件"; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/task/SaveToFileNewTask.java b/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/task/SaveToFileNewTask.java index cc09bfd..5359457 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/task/SaveToFileNewTask.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/task/SaveToFileNewTask.java @@ -148,7 +148,8 @@ public class SaveToFileNewTask { List list = null; try { if("excel文件".equals(tbUploadFileNewDto.getFileFormat())){ - list = ExcelUtils.excelParseListByUrl(filePath); + ExcelUtils excelUtils = new ExcelUtils(); + list = excelUtils.excelParseListByUrl(filePath); }else if ("txt文件".equals(tbUploadFileNewDto.getFileFormat())){ list = TxtUtils.txtParseListVyUrl(filePath); }else if ("csv文件".equals(tbUploadFileNewDto.getFileFormat())){ diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/util/ExcelUtils.java b/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/util/ExcelUtils.java index 0222f6d..e42be8a 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/util/ExcelUtils.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/uploadnew/util/ExcelUtils.java @@ -22,7 +22,7 @@ public class ExcelUtils { * @return * @throws IOException */ - public static List excelParseList(InputStream inputStream) throws IOException { + public List excelParseList(InputStream inputStream) throws IOException { List list = new ArrayList<>(); try { Workbook workbook = new XSSFWorkbook(inputStream); @@ -58,7 +58,7 @@ public class ExcelUtils { * @return * @throws IOException */ - public static List excelParseListByUrl(String url) throws IOException { + public List excelParseListByUrl(String url) throws IOException { List list = new ArrayList<>(); InputStream inputStream = new FileInputStream(new File(url)) ; try {