1、IDEA+DevTools实现热部署功能
转载:https://www.cnblogs.com/MrSi/p/9540730.html
2、SpringBoot+themleaf无法加载js、css等静态资源文件
解决方法:
第一步:将html网页文件放在类目录resources下的templates文件夹下面。
第二步:将需要的css、js放在static静态资源文件夹下面,文件结构如下图
<!-- 因为SpringBoot默认会在static路径下扫描静态资源,因此直接加路径static后面的路径即可 -->
<link rel="stylesheet" th:href="@{css/auth.css}">
<script type="text/javascript" th:src="@{js/auth.js}" ></script>
第三步:在html网页文件中,使用themleaf的th标签引用静态资源即可
3、JS中获取文件根目录的方法
function getRootPath_web() {
//获取当前网址,如: http://localhost:8080/uimcardprj/share/meun.jsp
var curWwwPath = window.document.location.href;
//获取主机地址之后的目录,如: uimcardprj/share/meun.jsp
var pathName = window.document.location.pathname;
var pos = curWwwPath.indexOf(pathName);
//获取主机地址,如: http://localhost:8080
var localhostPaht = curWwwPath.substring(0, pos);
//获取带"/"的项目名,如:/uimcardprj
var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
return (localhostPaht + projectName);
}
4、后台数据转换为JSON对象的方法
https://www.cnblogs.com/duende99/p/9306759.html