chore:1.0.17
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tiesheng/npm-tool",
|
||||
"version": "1.0.16",
|
||||
"version": "1.0.17",
|
||||
"description": "npm tool package",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -77,13 +77,15 @@ const dealParamsBody = (options) => {
|
||||
* @returns {Promise<<any>>}
|
||||
*/
|
||||
async function req(url, options) {
|
||||
let {prefix} = GlobalConfig.getConfig();
|
||||
let {prefix, urlDeal} = GlobalConfig.getConfig();
|
||||
if (typeof prefix === "function") {
|
||||
prefix = prefix(url);
|
||||
}
|
||||
if (prefix) {
|
||||
url = prefix + url;
|
||||
}
|
||||
url = urlDeal(url)
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
request(url, {
|
||||
...dealParamsBody(options),
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
const defaultConfig = {
|
||||
base64Key: "WmdUzPJXbngVNiaSsQrihg==",
|
||||
prefix: "",
|
||||
urlDeal: (url) => {
|
||||
return url;
|
||||
},
|
||||
onHttpError: (res) => {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user