feat: 注册准则阅读控制 + Footer 合规信息

准则阅读(三层控制):
- registration.show_guidelines — 弹窗/复选框模式
- registration.force_guidelines — 是否强制倒计时+滚动
- registration.guidelines_timer — 倒计时秒数

Footer 合规(8 字段,空值不显示,链接纯手写):
- site.operator_name / site.icp_number / site.icp_license
- site.police_number / site.wenwangwen / site.algorithm_filing
- site.privacy_url / site.terms_url
- 新增 safeHTML 模板函数输出不转义 HTML
This commit is contained in:
2026-06-21 23:50:52 +08:00
parent 0014bdb9ff
commit 1933ea86b4
9 changed files with 271 additions and 28 deletions

View File

@ -175,5 +175,32 @@ func injectSiteInfo(c *gin.Context, data gin.H) {
if copyrightStart, exists := c.Get("site_copyright_start"); exists {
data["CopyrightStart"] = copyrightStart
}
if operatorName, exists := c.Get("site_operator_name"); exists {
data["OperatorName"] = operatorName
}
if icpNumber, exists := c.Get("site_icp_number"); exists {
data["ICPNumber"] = icpNumber
}
if icpLicense, exists := c.Get("site_icp_license"); exists {
data["ICPLicense"] = icpLicense
}
if policeNumber, exists := c.Get("site_police_number"); exists {
data["PoliceNumber"] = policeNumber
}
if wenwangwen, exists := c.Get("site_wenwangwen"); exists {
data["WenWangWen"] = wenwangwen
}
if algorithmFiling, exists := c.Get("site_algorithm_filing"); exists {
data["AlgorithmFiling"] = algorithmFiling
}
if privacyURL, exists := c.Get("site_privacy_url"); exists {
data["PrivacyURL"] = privacyURL
}
if termsURL, exists := c.Get("site_terms_url"); exists {
data["TermsURL"] = termsURL
}
if guidelinesTimer, exists := c.Get("registration_guidelines_timer"); exists {
data["GuidelinesTimer"] = guidelinesTimer
}
data["CurrentYear"] = time.Now().Year()
}