From 8ef3693f9a10ebdb2f54a61bd81a2c600c3d8813 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Fri, 24 Jun 2022 11:50:14 +0800 Subject: [PATCH] Merge branch 'master' of http://120.27.238.55:7000/r/farmer-cms --- src/main/java/com/xcong/farmer/cms/common/system/controller/LoginController.java | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/xcong/farmer/cms/common/system/controller/LoginController.java b/src/main/java/com/xcong/farmer/cms/common/system/controller/LoginController.java index ee7c93c..cb41816 100644 --- a/src/main/java/com/xcong/farmer/cms/common/system/controller/LoginController.java +++ b/src/main/java/com/xcong/farmer/cms/common/system/controller/LoginController.java @@ -9,7 +9,7 @@ import com.xcong.farmer.cms.common.system.dto.LoginDto; import com.xcong.farmer.cms.utils.RedisUtils; import lombok.extern.slf4j.Slf4j; -import org.apache.tomcat.util.http.fileupload.FileUtils; +import org.apache.commons.io.FileUtils; import org.jsoup.Jsoup; import org.springframework.beans.factory.annotation.Value; import org.springframework.core.io.ClassPathResource; @@ -66,11 +66,12 @@ public Result html() throws IOException { // File file = ResourceUtils.getFile("classpath:static/index.html"); -// InputStream input = this.getClass().getClassLoader().getResourceAsStream("static/index.html"); -// File file = FileUtil.writeFromStream(input, ResourceUtils.getFile("static/index.html")); + InputStream input = this.getClass().getClassLoader().getResourceAsStream("static/index.html"); + File file = new File("index.html"); + FileUtils.copyToFile(input, file); - ClassPathResource classPathResource = new ClassPathResource("static/index.html"); - File file = classPathResource.getFile(); +// ClassPathResource classPathResource = new ClassPathResource("static/index.html"); +// File file = classPathResource.getFile(); return Result.ok("", Jsoup.parse(file, "utf-8").html()); } } -- Gitblit v1.9.1