fix v16
This commit is contained in:
@@ -78,3 +78,26 @@ hide-public、ban/restore、典型处置流程、排错表、明确不做的事
|
|||||||
实测(本地 SMTP sink,2 封):处置信含级别名/到期/申诉段;解除信含「已解除」+ 私密内容提示、
|
实测(本地 SMTP sink,2 封):处置信含级别名/到期/申诉段;解除信含「已解除」+ 私密内容提示、
|
||||||
**无申诉段**;两封都不含 `--reason`。`--no-notify` 两处都不发信;无生效处置时不发信。
|
**无申诉段**;两封都不含 `--reason`。`--no-notify` 两处都不发信;无生效处置时不发信。
|
||||||
`go build ./...`、db/i18n/templates 测试、checktpl 全绿。
|
`go build ./...`、db/i18n/templates 测试、checktpl 全绿。
|
||||||
|
|
||||||
|
## 上线前最终验收(部署后实测)
|
||||||
|
|
||||||
|
- 公开页:`/` `/rules` `/restricted` `/deactivated` 全部 200;`/rules` 四语言标题正确。
|
||||||
|
- 箱主面板(admin6,L2):条幅显示「收窄公开」+ 规则链接;严格度面板锁定提示 1 处、下拉 disabled。
|
||||||
|
- **L2 写入路径实测**(关键,因为改成了 `AnswerByIDPrivate` 单条 UPDATE):
|
||||||
|
对未回答题 q95 作答 → 302 回题目页 → flash「已保存为私密:当前处于平台处置期,回答不会公开」→ 匿名访问 302。
|
||||||
|
- 公开列表 API `/api/v1/user/{domain}/questions` 正常返回 `{code,data:{data,next_cursor,has_more}}`(新增的 L4/密码校验没有打断正常路径)。
|
||||||
|
- 整箱分享卡:受处置箱主 302(拦截生效);未处置箱主 500,原因是**测试站未配置字体**(`分享图生成失败:字体文件未配置或无法加载`),与本次改动无关。
|
||||||
|
这一点反而证明拦截位置在生成之前。
|
||||||
|
- 未能自测:CLI 发信(restrict/unrestrict 通知)需要在服务器上跑命令,只能由用户执行。
|
||||||
|
|
||||||
|
注意:admin6 现有测试题 73/88/89/90/94/95;其中 95 已被我回答并存为私密(内容带 `restrict self-check`)。
|
||||||
|
admin6 的 L2 于 2026-10-19 21:29 自动到期。
|
||||||
|
|
||||||
|
## 邮件模板统一(用户反馈:页脚与其它邮件不一致)
|
||||||
|
|
||||||
|
- 原因:`restriction-notice.html` 是我新写的,页脚用了自造的 `© 2026 TamaBox`,与项目其它 11 封邮件的
|
||||||
|
「此邮件由系统自动发送,请勿直接回复。<br/>{{ .year }} 狼的提问箱」不一致。
|
||||||
|
- 处理:整封模板按 `question-reported.html` 的结构重写(24px 标题 + `{{.time}}` 副行、同样的卡片/页脚/外间距),
|
||||||
|
`time` 由 `mail.SendRestrictionNoticeMail` 统一注入(调用方不用各自拼时间)。
|
||||||
|
- 实测(本地 SMTP sink):页脚文本与 question-reported 完全一致,`© ... TamaBox` 已消失,头部时间行存在。
|
||||||
|
- 注意:站点名在所有邮件模板里都是硬编码「狼的提问箱」,不是配置项;改站名要一起改 12 个模板。
|
||||||
|
|||||||
@@ -165,7 +165,10 @@ type RestrictionNotice struct {
|
|||||||
// SendRestrictionNoticeMail 告知箱主「你的提问箱已被限制」。
|
// SendRestrictionNoticeMail 告知箱主「你的提问箱已被限制」。
|
||||||
func SendRestrictionNoticeMail(n RestrictionNotice) error {
|
func SendRestrictionNoticeMail(n RestrictionNotice) error {
|
||||||
params := map[string]string{
|
params := map[string]string{
|
||||||
"heading": n.Heading,
|
"heading": n.Heading,
|
||||||
|
// time 由邮件包统一注入:调用方(CLI / 未来可能的自动流程)不必各自拼时间,
|
||||||
|
// 也保证与其他通知邮件(question-reported / abuse-alert)的头部格式一致。
|
||||||
|
"time": time.Now().Format("2006-01-02 15:04:05"),
|
||||||
"greeting": n.Greeting,
|
"greeting": n.Greeting,
|
||||||
"body": n.Body,
|
"body": n.Body,
|
||||||
"note": n.Note,
|
"note": n.Note,
|
||||||
|
|||||||
@@ -21,9 +21,12 @@
|
|||||||
<div style="border-style: solid; border-width: thin; border-color:#dadce0; border-radius: 8px; padding: 40px 20px;"
|
<div style="border-style: solid; border-width: thin; border-color:#dadce0; border-radius: 8px; padding: 40px 20px;"
|
||||||
align="center">
|
align="center">
|
||||||
<div style="font-family: 'Google Sans',Roboto,RobotoDraft,Helvetica,Arial,sans-serif;border-bottom: thin solid #dadce0; color: rgba(0,0,0,0.87); line-height: 32px; padding-bottom: 24px;text-align: center; word-break: break-word;">
|
<div style="font-family: 'Google Sans',Roboto,RobotoDraft,Helvetica,Arial,sans-serif;border-bottom: thin solid #dadce0; color: rgba(0,0,0,0.87); line-height: 32px; padding-bottom: 24px;text-align: center; word-break: break-word;">
|
||||||
<div style="font-size: 22px;">
|
<div style="font-size: 24px;">
|
||||||
{{.heading}}
|
{{.heading}}
|
||||||
</div>
|
</div>
|
||||||
|
<div style="font-size: 13px; color: rgba(0,0,0,0.54); margin-top: 6px;">
|
||||||
|
{{.time}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="font-family: Roboto-Regular,Helvetica,Arial,sans-serif; font-size: 14px; color: rgba(0,0,0,0.87); line-height: 22px; padding-top: 20px; text-align: left;">
|
<div style="font-family: Roboto-Regular,Helvetica,Arial,sans-serif; font-size: 14px; color: rgba(0,0,0,0.87); line-height: 22px; padding-top: 20px; text-align: left;">
|
||||||
<div>{{.greeting}}</div>
|
<div>{{.greeting}}</div>
|
||||||
@@ -35,18 +38,23 @@
|
|||||||
|
|
||||||
<div style="margin-top: 6px;">
|
<div style="margin-top: 6px;">
|
||||||
<a href="{{.rulesURL}}" target="_blank" rel="noopener"
|
<a href="{{.rulesURL}}" target="_blank" rel="noopener"
|
||||||
style="color: #1a73e8; text-decoration: none;">{{.rulesText}}</a>
|
style="color: #1e87f0; text-decoration: none;">{{.rulesText}}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{if .appeal}}
|
{{if .appeal}}
|
||||||
<div style="margin-top: 14px; color: rgba(0,0,0,0.6); font-size: 13px;">
|
<div style="font-size: 12px; color: rgba(0,0,0,0.54); margin-top: 12px;">
|
||||||
{{.appeal}}
|
{{.appeal}}
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="text-align: center; font-size: 12px; color: rgba(0,0,0,0.4); padding-top: 16px;">
|
<div style="text-align: left;">
|
||||||
© {{.year}} TamaBox
|
<div style="font-family: Roboto-Regular,Helvetica,Arial,sans-serif;color: rgba(0,0,0,0.54);font-size: 11px; line-height: 18px; padding-top: 12px; text-align: center;">
|
||||||
|
<div>
|
||||||
|
此邮件由系统自动发送,请勿直接回复。<br/>
|
||||||
|
{{ .year }} 狼的提问箱
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td width="8" style="width: 8px;"></td>
|
<td width="8" style="width: 8px;"></td>
|
||||||
@@ -55,6 +63,9 @@
|
|||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr height="32" style="height: 32px;">
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user