fix: wecom user agent
CI / changes (push) Successful in 12s
CI / ad (push) Successful in 1s
CI / admin (push) Successful in 0s
CI / bff (push) Failing after 25s
CI / chore (push) Successful in 1s
CI / express (push) Successful in 0s
CI / product (push) Successful in 27s
CI / sale (push) Successful in 0s
CI / user (push) Successful in 0s
CI / wecom (push) Successful in 25s

This commit is contained in:
zzw
2026-08-31 15:22:44 +08:00
parent 9111cb26e7
commit ce7aa18477
5 changed files with 0 additions and 11 deletions
-5
View File
@@ -10,19 +10,15 @@ import (
type BaseController struct{}
// Fail 基础错误的输出结果
func (b *BaseController) Fail(w http.ResponseWriter) {
b.Out(w, nil, Fail)
}
// Error 错误的输出结果
func (b *BaseController) Error(w http.ResponseWriter, cm Error) {
b.Out(w, nil, cm)
}
// Out 输出结果
func (b *BaseController) Out(w http.ResponseWriter, data any, cm Error) {
// 复制一份,避免并发请求改到包级 OK/Fail 单例
out := NewError(cm.GetCode(), cm.GetMsg()).WithData(data)
w.Header().Set("Content-Type", "application/json; charset=utf-8")
@@ -51,7 +47,6 @@ func (b *BaseController) OutPut(w http.ResponseWriter, code int32, data any, msg
}
}
// 复制一份,避免并发请求改到包级 OK/Fail 单例
out := NewError(int(code), msg).WithData(data)
w.Header().Set("Content-Type", "application/json; charset=utf-8")