小程序码落图片库并返回绝对地址

码图原先落在 qrcode 私有目录且返回相对路径,后台无法统一管理、
换部署域名还要改数据。现迁到图片库 manifest/static/qrcode/,
与头像/封面/附件共用同一套 /static 路由,并登记附件表
(scene=qrcode)使后台附件管理可统一查看管理。

库内仍只存相对路径、域名由 absoluteURL 按配置统一拼,与既有
约定一致;按内容 md5 命名,重复生成同一张码不新增文件。
活动码与项目绑定码共用 saveQrcodeImage helper。

另修正 .gitignore 漏掉的仓库根二进制(go build -o 的产物)。
This commit is contained in:
李琦
2026-10-13 16:23:21 +08:00
parent f0e833b84e
commit 2bce19b05b
6 changed files with 157 additions and 25 deletions

View File

@@ -507,6 +507,7 @@ const (
AttachmentSceneAvatar = "avatar" // 用户头像(小程序端上传)
AttachmentSceneCover = "cover" // 服务封面(管理端上传)
AttachmentSceneAttachment = "attachment" // 通用附件(管理端上传)
AttachmentSceneQrcode = "qrcode" // 小程序码(活动码 / 项目绑定码,迭代-2026-10-09)
)
// 站点 settings 键