diff --git a/hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/src/main/java/org/hswebframework/web/service/GenericEntityService.java b/hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/src/main/java/org/hswebframework/web/service/GenericEntityService.java index 65517310e..67269a454 100644 --- a/hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/src/main/java/org/hswebframework/web/service/GenericEntityService.java +++ b/hsweb-commons/hsweb-commons-service/hsweb-commons-service-simple/src/main/java/org/hswebframework/web/service/GenericEntityService.java @@ -53,8 +53,8 @@ public abstract class GenericEntityService, PK> */ protected abstract IDGenerator getIDGenerator(); - @Override - public abstract CrudDao getDao(); +// @Override +// public abstract CrudDao getDao(); @Override public int deleteByPk(PK pk) { diff --git a/hsweb-system/hsweb-system-file/hsweb-system-file-controller/src/main/java/org/hswebframework/web/controller/file/FileController.java b/hsweb-system/hsweb-system-file/hsweb-system-file-controller/src/main/java/org/hswebframework/web/controller/file/FileController.java index c487b20cb..9e15da5d5 100644 --- a/hsweb-system/hsweb-system-file/hsweb-system-file-controller/src/main/java/org/hswebframework/web/controller/file/FileController.java +++ b/hsweb-system/hsweb-system-file/hsweb-system-file-controller/src/main/java/org/hswebframework/web/controller/file/FileController.java @@ -53,7 +53,7 @@ import static java.util.Optional.ofNullable; @RestController @RequestMapping("${hsweb.web.mappings.file:file}") @Authorize(permission = "file", description = "文件管理") -@Api(value = "文件管理",tags = "文件管理-文件操作") +@Api(value = "文件管理", tags = "文件管理-文件操作") @SuppressWarnings("all") public class FileController { @@ -75,10 +75,6 @@ public class FileController { this.fileInfoService = fileInfoService; } - public static void main(String[] args) { - System.out.println(Base64.encodeBase64String("hello".getBytes())); - } - /** * 构建并下载zip文件.仅支持POST请求 * @@ -133,7 +129,8 @@ public class FileController { public void downloadTxt(@ApiParam("文件名") @PathVariable("name") String name, @ApiParam("文本内容") @RequestParam("text") String text, HttpServletResponse response) throws IOException { - response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); + response.setCharacterEncoding("utf-8"); + response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE + "; charset=utf-8"); response.setHeader("Content-disposition", "attachment;filename=" + URLEncoder.encode(name, "utf-8")); response.getWriter().write(text); }