fix typo error

This commit is contained in:
tamakyi
2026-09-10 19:27:21 +08:00
parent 8e2325eda5
commit e683e798aa
9 changed files with 176 additions and 109 deletions
+7 -5
View File
@@ -17,7 +17,8 @@ import (
func UpdatePagePassword(ctx context.Context, f form.UpdatePagePassword) {
// 反序列化失败(如请求体超限)时零值 Password="" 会把密码静默解除——先中止,
// 不触碰现有密码。govalid 校验失败(如密码超长)同样在此拦截,避免绕过前端限制。
if abortOnFormError(ctx, "/user/profile") {
// 该表单已随「内容防护」聚合迁入 security 面板,回跳地址跟随表单携带的 ?tab=。
if abortOnFormError(ctx, returnTab(ctx)) {
return
}
@@ -31,13 +32,14 @@ func UpdatePagePassword(ctx context.Context, f form.UpdatePagePassword) {
ctx.SetSuccessFlash(i18n.T(ctx.Lang(), "admin.flash.pagePwdUpdated"))
}
}
ctx.Redirect("/user/profile")
ctx.Redirect(returnTab(ctx))
}
// UpdateAskPassword 更新提问密码
func UpdateAskPassword(ctx context.Context, f form.UpdateAskPassword) {
// 同上:反序列化失败或校验失败时零值 Password="" 会把提问密码静默解除。
if abortOnFormError(ctx, profileURLWithTab(ProfileTabQuestion)) {
// 回跳地址跟随表单携带的 ?tab=(该表单已迁入「内容防护」security 面板)。
if abortOnFormError(ctx, returnTab(ctx)) {
return
}
@@ -51,6 +53,6 @@ func UpdateAskPassword(ctx context.Context, f form.UpdateAskPassword) {
ctx.SetSuccessFlash(i18n.T(ctx.Lang(), "admin.flash.askPwdUpdated"))
}
}
// 提问密码属于提问功能的专属设置,保存后回到「提问」面板
ctx.Redirect(profileURLWithTab(ProfileTabQuestion))
// 保存后回到提交时所在的面板(内容防护面板)
ctx.Redirect(returnTab(ctx))
}