Commit dd898f2a by liimin

refactor(adapter): 优化URL构建逻辑,合并查询字符串处理

1 parent 8a5497cc
......@@ -21,8 +21,7 @@ export function buildURL(baseURL: string = '', url: string = '', params: Record<
const queryParts = processedParams.map(({ key, value }) =>
`${encodeURIComponent(key)}=${encodeURIComponent(value)}`
);
const queryString = queryParts.join('&');
fullURL += (fullURL.includes('?') ? '&' : '?') + queryString;
fullURL += (fullURL.includes('?') ? '&' : '?') + queryParts.join('&');
}
return fullURL;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!