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