fix: 修复中文乱码

- 修复企业付款必传字段desc中文乱码的问题

Issues #4
Closes #4
This commit is contained in:
felord.cn
2021-01-25 16:03:29 +08:00
committed by felord.cn
parent 49bf3d3d50
commit 0d93361f6b

View File

@@ -38,6 +38,7 @@ import org.bouncycastle.crypto.digests.MD5Digest;
import org.bouncycastle.util.encoders.Hex; import org.bouncycastle.util.encoders.Hex;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.http.RequestEntity; import org.springframework.http.RequestEntity;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
@@ -146,7 +147,7 @@ public abstract class BaseModel {
RequestEntity<String> body = RequestEntity.method(method, UriComponentsBuilder.fromHttpUrl(url) RequestEntity<String> body = RequestEntity.method(method, UriComponentsBuilder.fromHttpUrl(url)
.build() .build()
.toUri()) .toUri())
.header("Content-Type", "application/x-www-form-urlencoded") .contentType(MediaType.valueOf("application/x-www-form-urlencoded;charset=UTF-8"))
.body(xml); .body(xml);
ResponseEntity<String> responseEntity = this.getRestTemplateClientAuthentication(mchId) ResponseEntity<String> responseEntity = this.getRestTemplateClientAuthentication(mchId)
.exchange(url, method, body, String.class); .exchange(url, method, body, String.class);