restrict v9
This commit is contained in:
@@ -151,7 +151,12 @@
|
||||
落 `/login` 会让用户以为没生效;该路由必须注册在**公开区**(`reqUserSignIn` 之外)。
|
||||
- **继续可登录的操作(改密码后重登)才用闪信 + `/login`**:顺序**先 `Session.Flush()` 再 `SetSuccessFlash()`**。
|
||||
- i18n 键名:`deactivate.*` = 停用表单页;`deactivated.*` = 停用成功页。
|
||||
- `templates/embed.go` 整目录 embed,**新增模板自动嵌入**,无需改指令。
|
||||
- ⚠️ **`templates/embed.go` 是显式清单,不是整目录 embed**:
|
||||
`//go:embed auth base mail question user chat vote home.html about-me.html sponsor.html rules.html change-logs.html pixel.html maintenance-mode.html`
|
||||
新增**顶层**模板必须加进这行指令,否则 `ctx.Success("xxx")` 在运行时报
|
||||
`html/template: "xxx" is undefined` → 500,而**编译期毫无提示**(测试也不渲染该页)。
|
||||
子目录(`user/` `mail/` `question/` 等)已被目录项整体覆盖,新增其中的文件不用改指令。
|
||||
2026-10-18 踩过一次:新增 `/rules` 页时漏加,线上只有该页 500。
|
||||
|
||||
## 仓库状态
|
||||
|
||||
|
||||
Reference in New Issue
Block a user