inleft
2022-08-12 fc74b40b05413d2fbf5667c129e23245d54ae6a8
系统配置更换
4 files modified
34 ■■■■■ changed files
snowy-base/snowy-core/src/main/java/vip/xiaonuo/core/context/constant/ConstantContextHolder.java 28 ●●●●● patch | view | raw | blame | history
snowy-main/src/main/java/vip/xiaonuo/modular/blogFile/BlogFileController.java 2 ●●● patch | view | raw | blame | history
snowy-main/src/main/java/vip/xiaonuo/modular/blogarticle/controller/BlogArticleOutsideController.java 2 ●●● patch | view | raw | blame | history
snowy-main/src/main/java/vip/xiaonuo/modular/blogarticlecomment/controller/BlogArticleCommentOutsideController.java 2 ●●● patch | view | raw | blame | history
snowy-base/snowy-core/src/main/java/vip/xiaonuo/core/context/constant/ConstantContextHolder.java
@@ -322,14 +322,6 @@
        return getSysConfig("SNOWY_ONLY_OFFICE_SERVICE_URL", String.class, true);
    }
    /**
     * 获取blog资源地址访问前缀
     *
     * @return
     */
    public static String getBlogSourcePrefix() {
        return getSysConfig("visit", String.class, true);
    }
    /**
     * 获取config表中的配置,如果为空返回默认值
@@ -420,11 +412,29 @@
    }
    /**
     * 获取自我认证密码
     * 获取blog资源地址访问前缀
     *
     * @return
     */
    public static String getBlogSourcePrefix() {
        return getSysConfig("visit", String.class, true);
    }
    /**
     * 授权访客密码
     *
     * @author inleft
     */
    public static String getAuthCode() {
        return getSysConfigWithDefault("inleft_AuthCode", String.class, null);
    }
    /**
     * 推送内容密码
     *
     * @author inleft
     */
    public static String getPushCode() {
        return getSysConfigWithDefault("inleft_PushCode", String.class, null);
    }
}
snowy-main/src/main/java/vip/xiaonuo/modular/blogFile/BlogFileController.java
@@ -72,7 +72,7 @@
            throw new BlogException("错误文件类型");
        }
        if (StrUtil.isEmpty(authCode) || !authCode.equals(ConstantContextHolder.getAuthCode())) {
        if (StrUtil.isEmpty(authCode) || !authCode.equals(ConstantContextHolder.getPushCode())) {
            throw new BlogException("授权码错误");
        }
snowy-main/src/main/java/vip/xiaonuo/modular/blogarticle/controller/BlogArticleOutsideController.java
@@ -81,7 +81,7 @@
    @PostMapping("/blogArticle/add")
    @BusinessLog(title = "外部blog系统_blog文章_增加", opType = LogAnnotionOpTypeEnum.ADD)
    public ResponseData add(@RequestBody @Validated(BlogArticleAddDto.add.class) BlogArticleAddDto addDto) {
        if (!SecureUtil.md5(addDto.getSecret()).equals("b49e4cc48616cfb8d5ed3e5b983165c8")) {
        if (!SecureUtil.md5(addDto.getSecret()).equals(ConstantContextHolder.getPushCode())) {
            throw new BlogException("口令错误..");
        }
snowy-main/src/main/java/vip/xiaonuo/modular/blogarticlecomment/controller/BlogArticleCommentOutsideController.java
@@ -85,7 +85,7 @@
        //自我认证
        if (MyConstant.myIds.contains(addDto.getVisitorNickName())) {
            if (StrUtil.isEmpty(addDto.getAuthCode()) || !addDto.getAuthCode().equals(ConstantContextHolder.getAuthCode())) {
            if (StrUtil.isEmpty(addDto.getAuthCode()) || !addDto.getAuthCode().equals(ConstantContextHolder.getPushCode())) {
                throw new BlogException("不要成为我,你就是真的自己");
            }
        }