feat: SSR 内容门控与积分钱包/签到抽奖

闭合积分解锁经济闭环:锁定壳与 unlock,以及 profile 钱包流水与每日签到/抽奖 PRG。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-29 06:20:12 +08:00
parent 40ec20b3df
commit 204e7fdb32
20 changed files with 818 additions and 107 deletions

View File

@@ -1,8 +1,8 @@
package services
import (
"fmt"
"regexp"
"strconv"
"strings"
"unicode/utf8"
)
@@ -54,10 +54,17 @@ func redactGatedBlocks(html string, re *regexp.Regexp, tag string) string {
}
length := gatedContentLength(inner)
gate := "login"
title := "登录后可见"
hint := "请登录后查看隐藏内容"
if tag == "reply-only" {
gate = "reply"
title = "回复后可见"
hint = "参与评论后即可查看"
}
return `<` + tag + ` data-gate="` + gate + `" data-locked="true" data-length="` + strconv.Itoa(length) + `"></` + tag + `>`
return fmt.Sprintf(
`<%s data-gate="%s" data-locked="true" data-length="%d"><div class="j13-gate" data-gate-shell="%s"><p class="j13-gate__title">%s</p><p class="j13-gate__meta">约 %d 字</p><p class="j13-gate__hint">%s</p></div></%s>`,
tag, gate, length, gate, title, length, hint, tag,
)
})
}