$this.store和require不能一起使用

那就让他去读服务器上的图片

springboot代码:

从别人那搜的

package test.test.tool;


import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class WebMvcConfigurer extends WebMvcConfigurerAdapter {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //和页面有关的静态目录都放在项目的static目录下
        registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
        //上传的图片在D盘下的img目录下,访问路径如:http://localhost:8081/img/mrtx.jpg
        //其中img表示访问的前缀。"file:D:/img/"是文件真实的存储路径
        registry.addResourceHandler("/img/**").addResourceLocations("file:D:/img/");
    }
}

 

现在我就能从网页访问头像的地址了Vue读不了assets下的vuex里面存的相对路径

Vue读不了assets下的vuex里面存的相对路径

 

Vue读不了assets下的vuex里面存的相对路径

相关文章:

  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
  • 2021-09-15
  • 2021-12-22
  • 2022-12-23
  • 1970-01-01
猜你喜欢
  • 2022-01-24
  • 2021-05-29
  • 2021-12-24
  • 2021-12-08
  • 2022-12-23
  • 2021-09-13
  • 2022-12-23
相关资源
相似解决方案