增加了对新榜未收录数据的订阅,并强制登陆信息为String (#5438)

This commit is contained in:
Henry Wang
2020-08-18 21:13:39 +01:00
committed by GitHub
2 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -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) {
+3 -1
View File
@@ -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,