perf:调整分页

This commit is contained in:
曾文豪
2023-03-27 11:18:55 +08:00
parent d93a76cd60
commit 2165bd8a02
2 changed files with 86 additions and 82 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "@tiesheng/npm-tool", "name": "@tiesheng/npm-tool",
"version": "1.0.8", "version": "1.0.10",
"description": "npm tool package", "description": "npm tool package",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@@ -77,8 +77,12 @@ const dealParamsBody = (options) => {
* @returns {Promise<<any>>} * @returns {Promise<<any>>}
*/ */
async function req(url, options) { async function req(url, options) {
if (GlobalConfig.getConfig().prefix) { let {prefix} = GlobalConfig.getConfig();
url = GlobalConfig.getConfig().prefix + url; if (typeof prefix === "function") {
prefix = prefix(url);
}
if (prefix) {
url = prefix + url;
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
request(url, { request(url, {