修复bug

This commit is contained in:
hero920103 committed 2026-10-19 17:34:11 +08:00
1 parent 1850ac640e
commit 892ba5886d
20 files changed
+1078 -178

No files matched your search

+4
View File
@@ -24,6 +24,10 @@ type AdminMenuController = BackendMenuController
// - 写接口(增删改、改状态)只有平台端能用,租户端能改菜单等于给自己开功能;
// - 读接口两端都能用,但租户端只能读租户端那一份(cid 强制为 2)。
func (c *BackendMenuController) denyMenu(code int, msg string) {
// 必须同时设置 HTTP 状态码:只把 code 写进 body 而返回 200 时,
// 前端 axios 拦截器会把这次鉴权失败当成成功响应,既不静默续期也不跳登录,
// 菜单等页面只会停在「token已过期」的报错里。
c.Ctx.Output.SetStatus(code)
c.Data["json"] = map[string]interface{}{"code": code, "msg": msg}
_ = c.ServeJSON()
}