标签:code pac rri xtend let 映射 imp override mac
1、配置工程访问路径映射本地路径;
package com.liuyanzhao.chuyun.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
* @author yhq
* @date 2018/2/27 下午3:32
*/
@Configuration
public class ApplicationConfig extends WebMvcConfigurerAdapter {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
//Windows下
registry.addResourceHandler("/uploads2/**").addResourceLocations("file:D:/uploads2/");
//Mac或Linux下(没有CDEF盘符)
registry.addResourceHandler("/uploads/**").addResourceLocations("file:/Users/uploads/");
super.addResourceHandlers(registry);
}
}
标签:code pac rri xtend let 映射 imp override mac
原文地址:https://www.cnblogs.com/yuhuiqing/p/10713791.html