首页>代码>springboot2.0+mybaits-plus+redis+mysql+vue实现用户数据的增删改查简单实例>/springboot_mp/src/main/java/com/ht/springboot_mp/common/MyConfig.java
package com.ht.springboot_mp.common;

/**
 * @company 宏图
 * @User Kodak
 * @create 2019-03-22 -20:58
 * 该类配置了可以访问static下所有文件夹
 * 并将文件上传配置在了本地文件上
 */
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@Configuration
public class MyConfig implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
        registry.addResourceHandler("/upload/**").addResourceLocations("file:D:/temp-rainy/upload/");
    }
}
最近下载更多
lingtiejing  LV15 2023年12月18日
flygrass  LV12 2023年12月5日
你爹正在加载中  LV4 2023年9月8日
龚顺龙  LV3 2023年8月7日
2017143155  LV12 2023年6月27日
czh20021029  LV1 2023年6月5日
wxy0309  LV6 2023年5月20日
bug428124  LV1 2023年3月12日
qwe123456asd  LV3 2023年3月8日
hbsoft2008  LV16 2023年2月17日
最近浏览更多
3263394665  LV9 3月15日
小王wang  LV10 2月29日
2237851964  LV1 2月19日
admin_z  LV22 1月10日
flygrass  LV12 2023年12月5日
唐唐丶  LV33 2023年11月20日
君知否  LV17 2023年9月28日
2304972630  LV3 2023年9月12日
你爹正在加载中  LV4 2023年9月8日
fcvgh cvx 2023年8月13日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友