From d25986093cfdb166209b5be743f7bf00440b36b1 Mon Sep 17 00:00:00 2001 From: ph Date: Sat, 12 Dec 2020 16:33:31 +0800 Subject: [PATCH] remove axios+0.19.2.patch --- build/scripts/ui.sh | 3 -- mindinsight/ui/package.json | 6 +-- third_party/patch/axios+0.19.2.patch | 55 ---------------------------- 3 files changed, 2 insertions(+), 62 deletions(-) delete mode 100644 third_party/patch/axios+0.19.2.patch diff --git a/build/scripts/ui.sh b/build/scripts/ui.sh index a1aaabc4..4a2173b7 100755 --- a/build/scripts/ui.sh +++ b/build/scripts/ui.sh @@ -25,9 +25,6 @@ build_ui() { fi rm -rf dist - mkdir -p patches - PATCH_PATH=$(realpath "$SCRIPT_BASEDIR/../../third_party/patch/axios+0.19.2.patch") - cp $PATCH_PATH patches/ npm config set strict-ssl false npm config set unsafe-perm true diff --git a/mindinsight/ui/package.json b/mindinsight/ui/package.json index 7e2c6411..ace9959e 100644 --- a/mindinsight/ui/package.json +++ b/mindinsight/ui/package.json @@ -6,8 +6,7 @@ "serve": "vue-cli-service serve", "build": "vue-cli-service build", "lint": "eslint src/**/*.js src/**/*.vue", - "i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'", - "postinstall": "patch-package" + "i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'" }, "dependencies": { "axios": "0.19.2", @@ -34,7 +33,6 @@ "sass": "1.25.0", "sass-loader": "8.0.0", "vue-cli-plugin-i18n": "0.6.1", - "vue-template-compiler": "2.6.11", - "patch-package": "6.2.2" + "vue-template-compiler": "2.6.11" } } diff --git a/third_party/patch/axios+0.19.2.patch b/third_party/patch/axios+0.19.2.patch deleted file mode 100644 index ffa74552..00000000 --- a/third_party/patch/axios+0.19.2.patch +++ /dev/null @@ -1,55 +0,0 @@ -diff --git a/node_modules/axios/lib/adapters/http.js b/node_modules/axios/lib/adapters/http.js -index 16dad12..0330430 100644 ---- a/node_modules/axios/lib/adapters/http.js -+++ b/node_modules/axios/lib/adapters/http.js -@@ -16,6 +16,31 @@ var enhanceError = require('../core/enhanceError'); - - var isHttps = /https:?/; - -+/** -+ * -+ * @param {http.ClientRequestArgs} options -+ * @param {AxiosProxyConfig} proxy -+ * @param {string} location -+ */ -+function setProxy(options, proxy, location) { -+ options.hostname = proxy.host; -+ options.host = proxy.host; -+ options.port = proxy.port; -+ options.path = location; -+ -+ // Basic proxy authorization -+ if (proxy.auth) { -+ var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); -+ options.headers['Proxy-Authorization'] = 'Basic ' + base64; -+ } -+ -+ // If a proxy is used, any redirects must also pass through the proxy -+ options.beforeRedirect = function beforeRedirect(redirection) { -+ redirection.headers.host = redirection.host; -+ setProxy(redirection, proxy, redirection.href); -+ }; -+} -+ - /*eslint consistent-return:0*/ - module.exports = function httpAdapter(config) { - return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) { -@@ -145,17 +170,8 @@ module.exports = function httpAdapter(config) { - } - - if (proxy) { -- options.hostname = proxy.host; -- options.host = proxy.host; - options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : ''); -- options.port = proxy.port; -- options.path = protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path; -- -- // Basic proxy authorization -- if (proxy.auth) { -- var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); -- options.headers['Proxy-Authorization'] = 'Basic ' + base64; -- } -+ setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); - } - - var transport;