From ea577c9147e3ae7e1aac5209d6cb51e440ef48f5 Mon Sep 17 00:00:00 2001
From: lzhe <181968431@qq.com>
Date: 星期四, 25 四月 2024 23:51:05 +0800
Subject: [PATCH] Merge branch 'master' of http://www.beijingsoft.cn:9090/r/smart-web
---
src/utils/tool.js | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/src/utils/tool.js b/src/utils/tool.js
index 8c027db..710f402 100644
--- a/src/utils/tool.js
+++ b/src/utils/tool.js
@@ -218,4 +218,15 @@
}
}
+tool.qsStringify = function(obj) {
+ return Object.keys(obj).map(key => {
+ if (Array.isArray(obj[key])) {
+ return obj[key]
+ .map(arrayValue => `${encodeURIComponent(key)}=${encodeURIComponent(arrayValue)}`)
+ .join('&');
+ }
+ return `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`;
+ }).join('&');
+}
+
export default tool
--
Gitblit v1.9.3