From 371b20009d3e46a6ae024b06eb388d04e106e1a0 Mon Sep 17 00:00:00 2001 From: xiaozhi <1822691309@qq.com> Date: Sun, 7 Jun 2026 11:07:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=A7=81=E6=9C=89=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E7=B1=BBxiaozhi=EF=BC=8C=E6=B7=BB=E5=8A=A0get?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E5=8F=82=E6=95=B0=E5=A4=84=E7=90=86=EF=BC=8C?= =?UTF-8?q?=E5=90=A7=E5=AF=B9=E8=B1=A1=E8=BD=ACURL=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/XiaoZhi.uts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 utils/XiaoZhi.uts diff --git a/utils/XiaoZhi.uts b/utils/XiaoZhi.uts new file mode 100644 index 0000000..41b892d --- /dev/null +++ b/utils/XiaoZhi.uts @@ -0,0 +1,19 @@ +export class XiaoZhi { + + /** + * 对象转URL参数 + */ + static tansParams(params : UTSJSONObject) : string { + const json = params.toMap() + let result = "" + json.forEach((value, key) => { + if (result.length > 0) { + result += "&" + } + result += encodeURIComponent(key) + + "=" + + encodeURIComponent(value.toString()) + }) + return result + } +} \ No newline at end of file