From 632459d647e3ceccb345a4d51e754bebda3a66e9 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 18 Apr 2019 00:09:14 +0800 Subject: [PATCH] clear up dependence --- lib/routes/douban/group.js | 2 +- lib/routes/jinritoutiao/keyword.js | 2 +- lib/routes/keep/user.js | 2 +- lib/routes/shanbay/checkin.js | 2 +- lib/routes/universities/hit/jwc.js | 2 +- package.json | 4 +--- yarn.lock | 24 +----------------------- 7 files changed, 7 insertions(+), 31 deletions(-) diff --git a/lib/routes/douban/group.js b/lib/routes/douban/group.js index 5eb062986..5a5ffed4c 100644 --- a/lib/routes/douban/group.js +++ b/lib/routes/douban/group.js @@ -1,4 +1,4 @@ -const axios = require('axios'); +const axios = require('../../utils/axios'); module.exports = async (ctx) => { const groupid = ctx.params.groupid; diff --git a/lib/routes/jinritoutiao/keyword.js b/lib/routes/jinritoutiao/keyword.js index 29a2cf4df..5dba054f8 100644 --- a/lib/routes/jinritoutiao/keyword.js +++ b/lib/routes/jinritoutiao/keyword.js @@ -1,4 +1,4 @@ -const axios = require('axios'); +const axios = require('../../utils/axios'); module.exports = async (ctx) => { const keyword = ctx.params.keyword; diff --git a/lib/routes/keep/user.js b/lib/routes/keep/user.js index 28db27c3b..7eb9f7531 100644 --- a/lib/routes/keep/user.js +++ b/lib/routes/keep/user.js @@ -1,4 +1,4 @@ -const axios = require('axios'); +const axios = require('../../utils/axios'); module.exports = async (ctx) => { const id = ctx.params.id; diff --git a/lib/routes/shanbay/checkin.js b/lib/routes/shanbay/checkin.js index 6751312d9..bc9b78530 100644 --- a/lib/routes/shanbay/checkin.js +++ b/lib/routes/shanbay/checkin.js @@ -1,4 +1,4 @@ -const axios = require('axios'); +const axios = require('../../utils/axios'); const cheerio = require('cheerio'); module.exports = async (ctx) => { diff --git a/lib/routes/universities/hit/jwc.js b/lib/routes/universities/hit/jwc.js index 86ddc6c4a..1f9a629eb 100644 --- a/lib/routes/universities/hit/jwc.js +++ b/lib/routes/universities/hit/jwc.js @@ -1,4 +1,4 @@ -const axios = require('axios'); +const axios = require('../../../utils/axios'); const cheerio = require('cheerio'); const url = require('url'); diff --git a/package.json b/package.json index 124ae1bd4..4b0e32dd4 100644 --- a/package.json +++ b/package.json @@ -33,13 +33,13 @@ "@vuepress/plugin-back-to-top": "1.0.0-alpha.47", "@vuepress/plugin-google-analytics": "1.0.0-alpha.47", "@vuepress/plugin-pwa": "1.0.0-alpha.47", - "axios-mock-adapter": "1.16.0", "eslint": "5.16.0", "eslint-config-prettier": "4.1.0", "eslint-plugin-prettier": "3.0.1", "jest": "24.7.1", "lint-staged": "8.1.5", "mockdate": "2.0.2", + "nock": "^10.0.6", "nodemon": "1.18.11", "prettier": "1.17.0", "prettier-check": "2.0.0", @@ -49,7 +49,6 @@ }, "dependencies": { "art-template": "4.13.2", - "axios": "0.18.0", "axios-retry": "3.1.2", "cheerio": "1.0.0-rc.3", "co-redis": "2.1.1", @@ -74,7 +73,6 @@ "luxon": "^1.7.1", "lz-string": "^1.4.4", "markdown-it": "^8.4.2", - "nock": "^10.0.6", "node-fetch": "^2.3.0", "path-to-regexp": "3.0.0", "pidusage": "^2.0.17", diff --git a/yarn.lock b/yarn.lock index 724bf0cb7..6cdefdbf9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1809,13 +1809,6 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== -axios-mock-adapter@1.16.0: - version "1.16.0" - resolved "https://registry.yarnpkg.com/axios-mock-adapter/-/axios-mock-adapter-1.16.0.tgz#cdd55bb60d8cb3fcd77fdb9cbb269e47b8b95180" - integrity sha512-m2D8ngMTQ5p4zZNBsPKoENgwz5rDfd0pZmXI/spdE2eeeKIcR3jquk+NRiBVFtb9UJlciBYplNzSUmgQ6X385Q== - dependencies: - deep-equal "^1.0.1" - axios-retry@3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/axios-retry/-/axios-retry-3.1.2.tgz#4f4dcbefb0b434e22b72bd5e28a027d77b8a3458" @@ -1823,14 +1816,6 @@ axios-retry@3.1.2: dependencies: is-retry-allowed "^1.1.0" -axios@0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.18.0.tgz#32d53e4851efdc0a11993b6cd000789d70c05102" - integrity sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI= - dependencies: - follow-redirects "^1.3.0" - is-buffer "^1.1.5" - babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -3441,7 +3426,7 @@ debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8: dependencies: ms "2.0.0" -debug@3.1.0, debug@=3.1.0, debug@~3.1.0: +debug@3.1.0, debug@~3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== @@ -4600,13 +4585,6 @@ follow-redirects@^1.0.0: dependencies: debug "^3.2.6" -follow-redirects@^1.3.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.6.1.tgz#514973c44b5757368bad8bddfe52f81f015c94cb" - integrity sha512-t2JCjbzxQpWvbhts3l6SH1DKzSrx8a+SsaVf4h6bG4kOXUuPYS/kg2Lr4gQSb7eemaHqJkOThF1BGyjlUkO1GQ== - dependencies: - debug "=3.1.0" - for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"