From c53f51546d7a02fc33daf65daee6bfe7cb577f41 Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 30 Dec 2019 11:40:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20order=20of=20offer(1point3acres);=20upda?= =?UTF-8?q?te:=20docs=20of=20offer(1point=E2=80=A6=20(#3644)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/bbs.md | 2 +- lib/routes/1point3acres/offer.js | 31 +++++++++++++++++++++++-------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/docs/bbs.md b/docs/bbs.md index da7ac6c0dd..b0b22d7d3d 100644 --- a/docs/bbs.md +++ b/docs/bbs.md @@ -183,7 +183,7 @@ pageClass: routes ### 录取结果 - + ::: warning 三个 id 获取方式 1. 打开 https://offer.1point3acres.com diff --git a/lib/routes/1point3acres/offer.js b/lib/routes/1point3acres/offer.js index 711585f175..cdcfbd5866 100644 --- a/lib/routes/1point3acres/offer.js +++ b/lib/routes/1point3acres/offer.js @@ -1,6 +1,7 @@ const got = require('@/utils/got'); module.exports = async (ctx) => { + // let out = ''; // const { id } = ctx.params; // const { year } = ctx.params.year || 'null'; // year 2017-2022 @@ -137,6 +138,26 @@ module.exports = async (ctx) => { } } const data = responseBasic.data.results; + // data.id-> 访问offer具体信息->获取 data.tid + // if (data.id !== 0) { + // out = await Promise.all( + // data.map(async (item) => { + // var gettidresponse = await got({ + // method: 'get', + // url: 'https://api.1point3acres.com/offer/results/'+ item.id + '/backgrounds', + // headers: { + // authorization: 'eyJhbGciOiJIUzUxMiIsImlhdCI6MTU3Njk5Njc5OSwiZXhwIjoxNTg0ODU5MTk5fQ.eyJ1aWQiOjQ1NzQyN30.0ei5UE6OgLBzN2_IS7xUIbIfW_S1Wzl42q2UeusbboxuzvctO_4Mz6YRr6f0PBLUVZMETxt8F0_4-yqIJ3_kUQ', + // }, + // }); + // var tid = gettidresponse.data.background.tid; + // //https: //www.1point3acres.com/bbs/thread-581177-1-1.html + // console.log(tid); + // const threadlink = 'https://www.1point3acres.com/bbs/thread-' + tid + '-1-1.html'; + // console.log(threadlink); + // return threadlink; + // }) + // ); + // } // let responseBasic_1; // responseBasic_1 = await got({ // method: 'get', @@ -190,15 +211,9 @@ module.exports = async (ctx) => { `提交时间:` + item.submittime + '
', - pubDate: new Date(item.submittime + ' GMT+8').toUTCString(), + // pubDate: new Date(item.submittime + ' GMT+8').toUTCString(), link: `https://offer.1point3acres.com`, - // responseBasic_1 =await got({ - // method: 'get', - // url: `https://api.1point3acres.com/offer/results/${item.id}/backgrounds`, - // headers: { - // authorization: `eyJhbGciOiJIUzUxMiIsImlhdCI6MTU3Njk5Njc5OSwiZXhwIjoxNTg0ODU5MTk5fQ.eyJ1aWQiOjQ1NzQyN30.0ei5UE6OgLBzN2_IS7xUIbIfW_S1Wzl42q2UeusbboxuzvctO_4Mz6YRr6f0PBLUVZMETxt8F0_4-yqIJ3_kUQ`, - // }, - // }).data.data.background.tid, + // link: out, })), }; };