方法1、如果你用的 vue-cli 3.0 ,可以使用 环境变量。具体的自己去看文档。

方法2、简单办法就是:
后端肯定是有个具体的域名地址给你的 http://xxxx.com/
let host = "后端的地址"
getImageList() {
getImageList().then(response => {
// 这里 data ,你遍历一下。
response.data = response.data.map((item,index)=>{
item.src = host + item.src
return item
})
this.imageList=response.data;
});
},

数据库存放的相对路径加域名地址,就是图片完整路径了;如果图片存webapi项目下,就是webapi的IP端口号,或者域名;如果是单独的图片服务器,那就是图片服务器的域名;

相关文章:

  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
  • 2022-01-01
  • 2021-05-23
  • 2022-12-23
  • 2021-09-14
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2021-04-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案