const Router = require("koa-router"); const zhihuRouter = new Router(); const axios = require("axios"); const { get, set, del } = require("../utils/cacheData"); // 接口信息 const routerInfo = { title: "知乎", subtitle: "热榜", }; // 缓存键名 const cacheKey = "zhihuData"; // 调用时间 let updateTime = new Date().toISOString(); // 调用路径 const url = "https://www.zhihu.com/hot"; const headers = { "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Mobile/15E148 Safari/604.1", }; // 数据处理 const getData = (data) => { if (!data) return []; const dataList = []; try { const pattern = /