From 79f68e52541eb4b20ab3280641493a54bea449b2 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Mon, 11 Nov 2019 12:17:50 +0800 Subject: [PATCH] chore: format --- lib/routes/lol/newsindex.js | 16 +++++++++------- lib/routes/pmcaff/list.js | 5 ++++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/routes/lol/newsindex.js b/lib/routes/lol/newsindex.js index 585054826..a6b00e90e 100644 --- a/lib/routes/lol/newsindex.js +++ b/lib/routes/lol/newsindex.js @@ -40,13 +40,15 @@ module.exports = async (ctx) => { let list; if (id !== '1934') { // 非社区的数据处理,多了callback需要截取 - const response = (await got({ - method: 'get', - url: apiUrl + id, - headers: { - Referer: refererUrl, - }, - })).data.trim(); + const response = ( + await got({ + method: 'get', + url: apiUrl + id, + headers: { + Referer: refererUrl, + }, + }) + ).data.trim(); try { const jsonString = response.slice(9, -2); list = JSON.parse(jsonString).data.result; diff --git a/lib/routes/pmcaff/list.js b/lib/routes/pmcaff/list.js index 99ded94af..4af69f812 100644 --- a/lib/routes/pmcaff/list.js +++ b/lib/routes/pmcaff/list.js @@ -1,6 +1,9 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); -const map = new Map([['1', { name: '今日推荐' }], ['2', { name: '精选' }]]); +const map = new Map([ + ['1', { name: '今日推荐' }], + ['2', { name: '精选' }], +]); module.exports = async (ctx) => { const typeid = ctx.params.typeid || '2'; const OutName = map.get(typeid).name;