From 96ad148e1ee859c2708a0ec7194f742fdb611a2c Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Fri, 24 Jun 2022 10:20:55 +0800
Subject: [PATCH] fix

---
 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