win提交

This commit is contained in:
2024-11-27 22:20:58 +08:00
parent b4297bf17c
commit 102c430df5
5 changed files with 46 additions and 9 deletions

View File

@@ -36,15 +36,15 @@ router.get('/hot', async (req, res) => {
// 搜索接口
// http://192.168.31.101:3030/v1/api/search?keyword=杨晨晨
router.get('/', async (req, res) => {
// http://192.168.31.101:3030/v1/api/search/key?keyword=杨晨晨&page=1
router.get('/key', async (req, res) => {
let { keyword, page } = req.query
page = page || 1
let $ = await Util.get(`${Config.baseUrl}/page/${page}?s=${encodeURI(keyword)}&type=post`)
let result = {
currentPage: page,
totalPage: $(".pagenav a").eq(2).text(),
totalPage: Number($(".pagenav a").eq(1).text()),
message: $(".search-content .badg .focus-color").text(),
list: [],
}

View File

@@ -4,7 +4,22 @@ import Config from '../config/config.js'
const router = express.Router();
// 获取 热门标签
// 获取 推荐标签
// http://192.168.31.101:3030/v1/api/tag/recommend
router.get('/recommend', async (req, res) => {
res.json({
status: 200,
copyright: `bmy ${new Date()}`,
data: [
{ title: '秀人网', count: '9059', url: '/xiuren' },
{ title: 'ROSI写真', count: '6580', url: '/domestic/rosi' },
{ title: '蜜桃社', count: '122', url: '/domestic/miitao' },
{ title: '尤物馆', count: '138', url: '/domestic/youwu' },
]
});
})
// 获取 所有标签
// http://192.168.31.101:3030/v1/api/tag/list
router.get('/list', async (req, res) => {
let $ = await Util.get(Config.hot_tags())