http加密修复

master
hzy 1 year ago
parent c6f712c547
commit 372f8e38fe
  1. 2
      transport/v1/http/response.go

@ -107,7 +107,7 @@ func (t *Transport) ResponseEncoderWithEncrypt() http.EncodeResponseFunc {
if t.env == enum.Env_Production { if t.env == enum.Env_Production {
ecbMsg, err := sm4.Sm4Ecb([]byte(t.sm4Key), data, true) ecbMsg, err := sm4.Sm4Ecb([]byte(t.sm4Key), data, true)
if err == nil { if err == nil {
dataRes = hex.EncodeToString(ecbMsg) dataRes = fmt.Sprintf("\"%s\"", hex.EncodeToString(ecbMsg))
w.Header().Set("en", "4") w.Header().Set("en", "4")
} }
} }

Loading…
Cancel
Save