| | |
| | | File jarFile = applicationHome.getDir(); |
| | | //在jar包所在目录下生成一个upload文件夹用来存储上传的图片 |
| | | |
| | | String baseDirPath; |
| | | if(YamlProperties.runModel == 1) { |
| | | //开发路径 |
| | | baseDirPath = jarFile.getParentFile().toString() + File.separator; |
| | | }else { |
| | | //打包路径 |
| | | baseDirPath = jarFile.toString() + File.separator; |
| | | } |
| | | registry.addResourceHandler("/**").addResourceLocations("file:/"+baseDirPath); |
| | | |
| | | //开发路径 |
| | | //String dirPath = jarFile.getParentFile().toString()+File.separator+"fg_photo_3DStation"+File.separator; |
| | |
| | | //String dirPathA059 = jarFile.toString()+File.separator+"A059"+File.separator+"images"+File.separator; |
| | | registry.addResourceHandler("/A059/images/**").addResourceLocations("file:"+dirPathA059); |
| | | |
| | | /**统一图片上传路径格式*/ |
| | | String baseDirPathmap;//百度地图 |
| | | String baseDirPath2; |
| | | String baseDirFilePath; |
| | | |
| | | |
| | | if(YamlProperties.runModel == 1) { |
| | | //开发路径 |
| | | baseDirPathmap = jarFile.getParentFile().toString()+File.separator+"baidumapv2"+File.separator; |
| | | baseDirPath2 = jarFile.getParentFile().toString()+File.separator+"fg_photo"+File.separator; |
| | | baseDirFilePath = jarFile.getParentFile().toString()+File.separator+"fg_file"+File.separator; |
| | | }else { |
| | | //打包路径 |
| | | baseDirPathmap = jarFile.toString()+File.separator+"baidumapv2"+File.separator; |
| | | baseDirPath2 = jarFile.toString()+File.separator+"fg_photo"+File.separator; |
| | | baseDirFilePath = jarFile.toString()+File.separator+"fg_file"+File.separator; |
| | | } |
| | | //registry.addResourceHandler("/**").addResourceLocations("file:/"+baseDirPath); |
| | | registry.addResourceHandler("/fg_photo/**").addResourceLocations("file:/"+baseDirPath2); |
| | | registry.addResourceHandler("/baidumapv2/**").addResourceLocations("file:/"+baseDirPathmap); |
| | | registry.addResourceHandler("/fg_file/**").addResourceLocations("file:/"+baseDirFilePath); |
| | | |
| | | super.addResourceHandlers(registry); |
| | | |
| | | } |