feat: 小程序演示版改造 + 服务端安全加固
Build and Publish Commercial Web / build (push) Failing after 25s
Publish Mini Program Dev Version / publish (push) Successful in 1m9s
Build and Publish Server / build (push) Failing after 6m42s

- 许愿树移除付费许愿/商品选择/微信支付调用,全部走免费许愿
- 许愿发布前接入微信 msgSecCheck v2 内容安全检测(access_token 内存缓存)
- 许愿字数限制改为按字符计算(中文按 1 字计)
- 占卜页改名「民俗趣算」并弱化「算命」措辞,占卜/每日运势页加文化声明
- 生产环境 JWT_SECRET 缺失或为默认值/不足 32 位时拒绝启动

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
gouki
2026-10-18 21:25:24 +00:00
co-authored by Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent 12fa2b0d19
commit 51d1a1999f
11 changed files with 238 additions and 152 deletions
+8
View File
@@ -18,6 +18,14 @@ import (
func Bootstrap() *config.Config {
_ = godotenv.Load(".env.local", "../.env.local", ".env")
cfg := config.Load()
// 生产环境安全底线:JWT 密钥必须是强随机值
if cfg.Server.Env == "production" {
if cfg.JWT.Secret == "" || cfg.JWT.Secret == "your-secret-key" || len(cfg.JWT.Secret) < 32 {
log.Fatal("JWT_SECRET 未配置或过短:生产环境必须设置至少 32 位的强随机密钥")
}
}
if err := config.InitDB(cfg); err != nil {
log.Fatalf("Failed to initialize database: %v", err)
}