|
|
@ -159,7 +159,7 @@ func (t *Transport) ResponseEncoderWithEncryptFilter(noEncrypt map[string]bool) |
|
|
|
|
|
|
|
|
|
|
|
dataRes := string(data) |
|
|
|
dataRes := string(data) |
|
|
|
// 正式服加密
|
|
|
|
// 正式服加密
|
|
|
|
if t.env == enum.Env_Production && noEncrypt[r.URL.Path] { |
|
|
|
if t.env == enum.Env_Production && !noEncrypt[r.URL.Path] { |
|
|
|
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 = fmt.Sprintf("\"%s\"", hex.EncodeToString(ecbMsg)) |
|
|
|
dataRes = fmt.Sprintf("\"%s\"", hex.EncodeToString(ecbMsg)) |
|
|
|