“mitao”
2026-04-30 0c98579fff979ae80fc30224b87c9c6eb626f49e
tcm-training-admin-backend/src/main/java/com/tcm/training/admin/app/share/service/AppShareService.java
@@ -301,21 +301,16 @@
     * 构建二维码图片公开访问地址。
     */
    private String buildQrCodeImageUrl(String inviteCode) {
        String landingBaseUrl = trimToNull(appShareProperties.getLandingBaseUrl());
        if (landingBaseUrl == null) {
            throw new IllegalArgumentException("邀请下载页地址暂未配置");
        String qrcodeImageBaseUrl = trimToNull(appShareProperties.getQrcodeImageBaseUrl());
        if (qrcodeImageBaseUrl == null) {
            throw new IllegalArgumentException("分享二维码图片地址暂未配置");
        }
        int schemeIndex = landingBaseUrl.indexOf("://");
        if (schemeIndex < 0) {
            throw new IllegalArgumentException("邀请下载页地址格式不正确");
        }
        int hostEndIndex = landingBaseUrl.indexOf('/', schemeIndex + 3);
        String origin = hostEndIndex >= 0 ? landingBaseUrl.substring(0, hostEndIndex) : landingBaseUrl;
        String normalizedInviteCode = trimToNull(inviteCode);
        if (!StringUtils.hasText(normalizedInviteCode)) {
            throw new IllegalArgumentException("邀请码不能为空");
        }
        return origin + "/api/open/app-share/qrcode-image?inviteCode=" + normalizedInviteCode;
        String queryJoiner = qrcodeImageBaseUrl.contains("?") ? "&" : "?";
        return qrcodeImageBaseUrl + queryJoiner + "inviteCode=" + normalizedInviteCode;
    }
    /**