From 02587e29b0fb6c2bf84107fe6e549697b69e3134 Mon Sep 17 00:00:00 2001 From: huiminwen <80533196+huiminwen@users.noreply.github.com> Date: Fri, 19 May 2023 17:53:25 +0800 Subject: [PATCH] fix: A bug fix (#12539) * Update zcc.js * fix:Update zcc.js * fix:Update zcc.js * fix: A bug fix --- lib/v2/nju/zcc.js | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/lib/v2/nju/zcc.js b/lib/v2/nju/zcc.js index eb6481e5b..cbea3706a 100644 --- a/lib/v2/nju/zcc.js +++ b/lib/v2/nju/zcc.js @@ -1,24 +1,19 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); const { parseDate } = require('@/utils/parse-date'); - module.exports = async (ctx) => { const category_dict = { - gyfytdglk: '公用房与土地管理科', - zfglk: '住房管理科', - xxzhk: '信息综合科', - czcjk: '出租出借管理科', - gyzcglk: '国有资产管理科', + ggtz: '公告通知', }; const items = await Promise.all( - Object.keys(category_dict).map(async (c) => { - const response = await got(`https://zcc.nju.edu.cn/tzgg/${c}/index.html`); + Object.keys(category_dict).map(async () => { + const response = await got(`https://zcc.nju.edu.cn/sy/tzzhxx/index.html`); const data = response.data; const $ = cheerio.load(data); let script = $('ul.clearfix').find('script'); - script = script['2'].children[0].data; + script = script['1'].children[0].data; const start = script.indexOf('['); const end = script.lastIndexOf(']'); @@ -32,15 +27,14 @@ module.exports = async (ctx) => { link: item.url, author: item.username, pubDate: parseDate(item.releasetime, 'x'), - category: category_dict[c], })) ); }) ); ctx.state.data = { - title: '资产管理处-通知公告', - link: 'https://zcc.nju.edu.cn/tzgg/index.html', - item: [...items[0], ...items[1], ...items[2], ...items[3], ...items[4]], + title: '资产管理处-公告通知', + link: 'https://zcc.nju.edu.cn/sy/tzzhxx/index.html', + item: items[0], }; };