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",
"version": "1.0.8",
"version": "1.0.10",
"description": "npm tool package",
"main": "index.js",
"scripts": {

View File

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