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}` } /**