zhou zhou
2 天以前 03c3e3cfc1262e26a218a4b8340c0a53ca3065c6
rsf-server/src/main/java/com/vincent/rsf/server/system/controller/ProjectLogoController.java
@@ -81,7 +81,12 @@
                .eq(Config::getFlag, flag)
                .eq(Config::getStatus, StatusType.ENABLE.val)
                .last("limit 1"));
        return R.ok().add(configs.stream().findFirst().orElse(null));
        Config config = configs.stream().findFirst().orElse(null);
        if (config != null && PROJECT_LOGO_FLAG.equals(flag)) {
            config.setVal(resolveProjectLogoValue(config.getVal()));
        }
        return R.ok().add(config);
    }
    @PreAuthorize("hasAnyAuthority('system:config:save','system:config:update')")
@@ -155,6 +160,22 @@
        return resolvedPath;
    }
    private String resolveProjectLogoValue(String value) {
        if (!StringUtils.hasText(value)) {
            return "";
        }
        int pathIndex = value.indexOf("?path=");
        if (pathIndex < 0) {
            return value;
        }
        String relativePath = value.substring(pathIndex + 6);
        if (!StringUtils.hasText(relativePath)) {
            return "";
        }
        File file = resolveLogoPath(relativePath).toFile();
        return file.exists() && file.isFile() ? value : "";
    }
    private String resolveImageContentType(String fileName) {
        String normalizedName = StringUtils.hasText(fileName) ? fileName.toLowerCase(Locale.ROOT) : "";
        if (normalizedName.endsWith(".png")) {