Commit a1b07adbf6af136a8c360ca7daa4c9a33eb77f15
1 parent
187acad8
【代码优化】增强 JDK17、JDK8 之间的兼容性
Showing
1 changed file
with
1 additions
and
1 deletions
yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/framework/sms/core/client/impl/AliyunSmsClient.java
| @@ -190,7 +190,7 @@ public class AliyunSmsClient extends AbstractSmsClient { | @@ -190,7 +190,7 @@ public class AliyunSmsClient extends AbstractSmsClient { | ||
| 190 | @SneakyThrows | 190 | @SneakyThrows |
| 191 | private static String percentCode(String str) { | 191 | private static String percentCode(String str) { |
| 192 | Assert.notNull(str, "str 不能为空"); | 192 | Assert.notNull(str, "str 不能为空"); |
| 193 | - return URLEncoder.encode(str, StandardCharsets.UTF_8) | 193 | + return HttpUtils.encodeUtf8(str) |
| 194 | .replace("+", "%20") // 加号 "+" 被替换为 "%20" | 194 | .replace("+", "%20") // 加号 "+" 被替换为 "%20" |
| 195 | .replace("*", "%2A") // 星号 "*" 被替换为 "%2A" | 195 | .replace("*", "%2A") // 星号 "*" 被替换为 "%2A" |
| 196 | .replace("%7E", "~"); // 波浪号 "%7E" 被替换为 "~" | 196 | .replace("%7E", "~"); // 波浪号 "%7E" 被替换为 "~" |