From 3a6bb410c5bdb9610c287b20b6dabe935d00a447 Mon Sep 17 00:00:00 2001 From: zm2000 <18386612143@163.com> Date: Sat, 23 May 2026 16:56:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E5=BD=95=E9=A1=B5?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E5=B9=B3=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .hbuilderx/launch.json | 9 +++++++++ src/api/request.ts | 14 +++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 .hbuilderx/launch.json diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json new file mode 100644 index 0000000..8ae452a --- /dev/null +++ b/.hbuilderx/launch.json @@ -0,0 +1,9 @@ +{ + "version" : "1.0", + "configurations" : [ + { + "playground" : "standard", + "type" : "uni-app:app-android" + } + ] +} diff --git a/src/api/request.ts b/src/api/request.ts index 2533fb9..d0c88a5 100644 --- a/src/api/request.ts +++ b/src/api/request.ts @@ -41,12 +41,20 @@ function getAuthHeader(): Record { } function buildRequestUrl(method: string): string { - const params = new URLSearchParams({ + const params = { method, v: '1.0', timestamp: String(Date.now()), - }) - return `${API_URL}?${params.toString()}` + } + const queryList: string[] = [] + for (const key in params) { + if (Object.prototype.hasOwnProperty.call(params, key)) { + const value = params[key as keyof typeof params] + queryList.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`) + } + } + const query = queryList.join('&') + return `${API_URL}?${query}` } /**