1.修改server.xml - 打开tomcat\conf\server.xml - 在host标签内添加两个context,docBase填本地绝对路径
<Context docBase="D:\developer\git\cloud\cqliving-framework-cloud-ui\cqliving-framework-cloud-ui-nazox\src\main\resources\nazox" path="/nazoxadmin" reloadable="false"/>
<Context docBase="D:\developer\git\cloud\cqliving-framework-cloud-ui\cqliving-framework-cloud-ui-layui\src\main\resources\layui\layuiadmin" path="/layuiadmin" reloadable="false"/>
2. 修改web.xml跨域设置
此配置用于资源跨域修复 - 打开tomcat\conf\web.xml - 在welcome-file-list标签前添加如下标签
<filter>
<filter-name>CorsFilter</filter-name>
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
<init-param>
<param-name>cors.allowed.origins</param-name>
<param-value>*</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CorsFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
3.重启不tomcat不报错即可