我在配置小程序接口运行程序的时候,遇到小程序需要访问图片资源,但是图片资源在程序包外部,然后翻文档解决这个问题,希望能帮到其他人
在application.properties配置文件中加如下配置
web.upload-path=/data/imgHome/webImg/ 外部只要绝对路径
spring.mvc.static-path-pattern=/**
spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${web.upload-path}