From 2cf8a638c843f42013c85ee9c7a957417149111b Mon Sep 17 00:00:00 2001 From: BossDoge Date: Mon, 17 Aug 2020 00:35:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E5=AF=B9=E6=96=B0?= =?UTF-8?q?=E6=A6=9C=E6=9C=AA=E6=94=B6=E5=BD=95=E6=95=B0=E6=8D=AE=E7=9A=84?= =?UTF-8?q?=E8=AE=A2=E9=98=85=EF=BC=8C=E5=B9=B6=E5=BC=BA=E5=88=B6=E7=99=BB?= =?UTF-8?q?=E9=99=86=E4=BF=A1=E6=81=AF=E4=B8=BAString?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/newrank/utils.js | 4 ++-- lib/routes/newrank/wechat.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/routes/newrank/utils.js b/lib/routes/newrank/utils.js index 29427278f..ff4d0e1e6 100644 --- a/lib/routes/newrank/utils.js +++ b/lib/routes/newrank/utils.js @@ -69,8 +69,8 @@ async function getCookie(ctx) { // Check if this key should be replace? every 30 times should be fine. await shouldUpdateCookie(ctx); let token = await ctx.cache.get(newrank_cookie_token); - const username = config.newrank.username; - const password = md5(md5(config.newrank.password) + 'daddy'); + const username = String(config.newrank.username); + const password = md5(md5(String(config.newrank.password)) + 'daddy'); const nonce = random_nonce(9); const xyz = decrypt_login_xyz(username, password, nonce); if (!token) { diff --git a/lib/routes/newrank/wechat.js b/lib/routes/newrank/wechat.js index 49afadeca..365591501 100644 --- a/lib/routes/newrank/wechat.js +++ b/lib/routes/newrank/wechat.js @@ -18,9 +18,11 @@ module.exports = async (ctx) => { }, }); const name = response.data.value.user.name; + const realTimeArticles = utils.flatten(response.data.value.realTimeArticles); const articles = utils.flatten(response.data.value.articles); + const newArticles = realTimeArticles.concat(articles); const items = await Promise.all( - articles.map(async (item) => ({ + newArticles.map(async (item) => ({ title: item.title, description: '', link: item.url,