From a71dacada24ef2c4e2e2718471c4b5efef403221 Mon Sep 17 00:00:00 2001
From: tuqin <tuqin@tuqin.cn>
Date: 星期五, 16 十月 2026 09:19:28 +0800
Subject: [PATCH] fix(sql): 售后/问题库 SQL 追加 SET NAMES utf8mb4,修复 aftersale_reason_type 等字典/菜单中文双重编码乱码
---
yudao-framework/yudao-common/src/test/java/cn/iocoder/yudao/framework/common/util/http/HttpUtilsTest.java | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/yudao-framework/yudao-common/src/test/java/cn/iocoder/yudao/framework/common/util/http/HttpUtilsTest.java b/yudao-framework/yudao-common/src/test/java/cn/iocoder/yudao/framework/common/util/http/HttpUtilsTest.java
index a42874f..e2b6120 100644
--- a/yudao-framework/yudao-common/src/test/java/cn/iocoder/yudao/framework/common/util/http/HttpUtilsTest.java
+++ b/yudao-framework/yudao-common/src/test/java/cn/iocoder/yudao/framework/common/util/http/HttpUtilsTest.java
@@ -10,6 +10,36 @@
public class HttpUtilsTest {
@Test
+ public void testEncodeUrlPath() {
+ // 鍑嗗鍙傛暟
+ String path = "avatar/涓枃 100%+鏂囦欢.jpg";
+
+ // 璋冪敤
+ String result = HttpUtils.encodeUrlPath(path);
+
+ // 鏂█
+ assertEquals("avatar/%E4%B8%AD%E6%96%87%20100%25+%E6%96%87%E4%BB%B6.jpg", result);
+ }
+
+ @Test
+ public void testDecodeUrlPath() {
+ // 鍑嗗鍙傛暟锛�+ 鏄矾寰勫瓧绗︼紝涓嶅簲璇ユ寜 query parameter 璇箟瑙g爜涓虹┖鏍�
+ String path = "avatar/%E4%B8%AD%E6%96%87%20100%25+%E6%96%87%E4%BB%B6.jpg";
+
+ // 璋冪敤
+ String result = HttpUtils.decodeUrlPath(path);
+
+ // 鏂█
+ assertEquals("avatar/涓枃 100%+鏂囦欢.jpg", result);
+ }
+
+ @Test
+ public void testRemoveUrlPathQueryAndFragment() {
+ assertEquals("avatar/test.jpg", HttpUtils.removeUrlPathQueryAndFragment("avatar/test.jpg?token=1#preview"));
+ assertEquals("avatar/test.jpg", HttpUtils.removeUrlPathQueryAndFragment("avatar/test.jpg#preview?token=1"));
+ }
+
+ @Test
public void testReplaceUrlQuery_replace() {
// 鍑嗗鍙傛暟
String url = "https://www.iocoder.cn/path?a=1&b=2";
--
Gitblit v1.9.3