1、配置限制ip访问

打开 tomcat里conf文件下的server.xml

在<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">下添加代码

<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="10.61.*.*||10.66.*.*" deny=""/>

“||“是或者的意思

“*”为整个ip段

2、设置图片服务器

打开server.xml

在<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">下添加代码

 

<Context docBase="D:\GoodsImgs" path="/GoodsImgs" reloadable="true"/>

使用方法

$("#img").attr("src","http://你的ip:8080/GoodsImgs/"+data[1].img);

 

相关文章:

  • 2022-01-18
  • 2021-12-05
  • 2021-12-05
  • 2021-10-21
  • 2022-01-03
  • 2021-06-04
  • 2021-12-30
猜你喜欢
  • 2021-11-27
  • 2021-12-08
  • 2022-12-23
  • 2021-12-12
  • 2021-11-22
  • 2021-11-27
  • 2021-05-18
相关资源
相似解决方案