一、目录结构 二、本地获取资源 //windows下获取文件 if(System.getProperty("os.name").toLowerCase().contains("windows")){ new File(Resources.getResource("img/eCode.png").getPath()); }else{ // linux下获取文件 new ClassPathResource("classpath:img/w.jpg").getInputStream(); }