whyclxw
2025-05-28 e16302f9d475c7cc4dd18c5abf1a23cb5502e362
src/main/java/com/whyc/config/StaticResourceConfig.java
@@ -62,20 +62,26 @@
        registry.addResourceHandler("/A059/images/**").addResourceLocations("file:"+dirPathA059);
        /**统一图片上传路径格式*/
        String baseDirPath;
        String baseDirPathmap;//百度地图
        String baseDirPath2;
        String baseDirFilePath;
        if(YamlProperties.runModel == 1) {
            //开发路径
            baseDirPath = jarFile.getParentFile().toString()+File.separator;
            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 {
            //打包路径
            baseDirPath = jarFile.toString()+File.separator;
            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("/**").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);