fix
Helius
2022-06-24 96ad148e1ee859c2708a0ec7194f742fdb611a2c
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());
    }
}