diff --git a/response/response.go b/response/response.go index fe000bb..f0cfbef 100644 --- a/response/response.go +++ b/response/response.go @@ -8,8 +8,8 @@ package response import ( - "git.zhangdeman.cn/zhangdeman/dynamic-struct/wrapper" "fmt" + "git.zhangdeman.cn/zhangdeman/dynamic-struct/wrapper" "git.zhangdeman.cn/zhangdeman/serialize" "net/http" "strings" @@ -67,12 +67,12 @@ func SuccessWithExtension(ctx *gin.Context, data any, responseOption *define.Res func Send(ctx *gin.Context, code any, httpCode int, data any, responseOption *define.ResponseOption) { if nil == responseOption { responseOption = &define.ResponseOption{ - ContentType: "application/json", + ContentType: "application/json; charset=utf-8", Extension: make(map[string]any), } } if len(responseOption.ContentType) == 0 { - responseOption.ContentType = "application/json" + responseOption.ContentType = "application/json; charset=utf-8" } if len(responseOption.XmlName) == 0 { responseOption.XmlName = "ResponseData"