diff --git a/.eslintrc.json b/.eslintrc.json index f86ea69c2..fd8939b55 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -62,13 +62,13 @@ "unicorn/numeric-separators-style": [ "warn", { - "onlyIfContainsSeparator": false, - "number": { "minimumDigits": 7, "groupLength": 3 }, - "binary": { "minimumDigits": 9, "groupLength": 4 }, - "octal": { "minimumDigits": 9, "groupLength": 4 }, - "hexadecimal": { "minimumDigits": 5, "groupLength": 2 } + "onlyIfContainsSeparator": false, + "number": { "minimumDigits": 7, "groupLength": 3 }, + "binary": { "minimumDigits": 9, "groupLength": 4 }, + "octal": { "minimumDigits": 9, "groupLength": 4 }, + "hexadecimal": { "minimumDigits": 5, "groupLength": 2 } } - ], + ], "unicorn/prefer-code-point": 1, "unicorn/prefer-logical-operator-over-ternary": 1, "unicorn/prefer-module": 0, diff --git a/lib/routes/eleme/open/announce.js b/lib/routes/eleme/open/announce.js index 96182470b..dfd890745 100644 --- a/lib/routes/eleme/open/announce.js +++ b/lib/routes/eleme/open/announce.js @@ -1,27 +1,24 @@ const got = require('@/utils/got'); module.exports = async (ctx) => { - const data = ( - await got({ - method: 'post', - url: 'https://app-api.shop.ele.me/arena/invoke/?method=NoticeKeeperService.getBroadcastList', - json: { - id: '5CC2B32FA6F24CF78CB300DDE2F370BE|1565511577423', - metas: { - appName: 'Odin', - appVersion: '4.4.0', - }, - service: 'NoticeKeeperService', - method: 'getBroadcastList', - params: { - offset: 0, - limit: 999, - }, - ncp: '2.0.0', + const { data } = await got({ + method: 'post', + url: 'https://app-api.shop.ele.me/arena/invoke/?method=NoticeKeeperService.getBroadcastList', + json: { + id: '5CC2B32FA6F24CF78CB300DDE2F370BE|1565511577423', + metas: { + appName: 'Odin', + appVersion: '4.4.0', }, - }) - ).data; - + service: 'NoticeKeeperService', + method: 'getBroadcastList', + params: { + offset: 0, + limit: 999, + }, + ncp: '2.0.0', + }, + }); ctx.state.data = { title: '饿了么商家开放平台-公告', link: 'https://open.shop.ele.me/openapi/publicnotice/0', diff --git a/lib/v2/mangadex/index.js b/lib/v2/mangadex/index.js index 39741cb43..0791296e5 100644 --- a/lib/v2/mangadex/index.js +++ b/lib/v2/mangadex/index.js @@ -4,7 +4,7 @@ const { RequestInProgressError } = require('@/errors'); module.exports = async (ctx) => { const { id, lang } = ctx.params; - let data = (await got.get(`https://api.mangadex.org/manga/${id}`)).data; + let { data } = await got.get(`https://api.mangadex.org/manga/${id}`); if (data.result === 'error') { throw new RequestInProgressError(data.errors[0].detail); }