1、客戶端及小程序調(diào)用接口時(shí),出現(xiàn)亂碼,如下:

InputStream inputStream = request.getInputStream();
String str = StreamUtils.copyToString(inputStream, Charset.forName("UTF-8")); 執(zhí)行以上代碼后出現(xiàn)下面新的亂碼:

發(fā)現(xiàn)是SpringBoot自帶的tomcat的配置問題引起
于是在 “application.properties” 中添加?server.tomcat.uri-encoding=UTF-8 亂碼解決。