From 09c92b363ef90ad4fbb8ae2e5ade5fe70c4c13e1 Mon Sep 17 00:00:00 2001 From: imlonghao Date: Wed, 8 Aug 2018 17:32:46 +0800 Subject: [PATCH] fix axios params error (#436) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit axios 中设置 headers 的参数应该是 `headers` 而不是 `header` --- routes/greasyfork/scripts.js | 2 +- routes/scnu/cs/match.js | 2 +- routes/scnu/jw.js | 2 +- routes/scnu/library.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/routes/greasyfork/scripts.js b/routes/greasyfork/scripts.js index d3fefd35c..03c75b1be 100644 --- a/routes/greasyfork/scripts.js +++ b/routes/greasyfork/scripts.js @@ -15,7 +15,7 @@ module.exports = async (ctx) => { filter_locale: filter_locale, sort: 'updated', }, - header: { + headers: { 'User-Agent': config.ua, }, }); diff --git a/routes/scnu/cs/match.js b/routes/scnu/cs/match.js index 892992f58..031f5a576 100644 --- a/routes/scnu/cs/match.js +++ b/routes/scnu/cs/match.js @@ -6,7 +6,7 @@ module.exports = async (ctx) => { const res = await axios({ method: 'get', url: 'https://cs.scnu.edu.cn/xueshenggongzuo/chengchangfazhan/kejichuangxin/', - header: { + headers: { 'User-Agent': config.ua, Referer: 'https://cs.scnu.edu.cn', }, diff --git a/routes/scnu/jw.js b/routes/scnu/jw.js index d4d5eb361..4e2760f02 100644 --- a/routes/scnu/jw.js +++ b/routes/scnu/jw.js @@ -6,7 +6,7 @@ module.exports = async (ctx) => { const res = await axios({ method: 'get', url: 'https://jw.scnu.edu.cn/ann/index.html', - header: { + headers: { 'User-Agent': config.ua, Referer: 'https://jw.scnu.edu.cn', }, diff --git a/routes/scnu/library.js b/routes/scnu/library.js index 976b6e485..f54bd3d21 100644 --- a/routes/scnu/library.js +++ b/routes/scnu/library.js @@ -6,7 +6,7 @@ module.exports = async (ctx) => { const res = await axios({ method: 'get', url: 'https://lib.scnu.edu.cn/news/zuixingonggao', - header: { + headers: { 'User-Agent': config.ua, Referer: 'https://lib.scnu.edu.cn', },