diff --git a/lib/routes/hpoi/info.js b/lib/routes/hpoi/info.js
index 244126c494..c2cd6f9d2b 100644
--- a/lib/routes/hpoi/info.js
+++ b/lib/routes/hpoi/info.js
@@ -4,7 +4,8 @@ const FormData = require('form-data');
module.exports = async (ctx) => {
const { type = 'all' } = ctx.params;
- const reqUrl = 'https://www.hpoi.net/user/home/ajax';
+ const baseUrl = 'https://www.hpoi.net';
+ const reqUrl = `${baseUrl}/user/home/ajax`;
const formData = new FormData();
Object.entries({
page: 1,
@@ -20,7 +21,7 @@ module.exports = async (ctx) => {
.map((_, ele) => {
const $item = cheerio.load(ele);
const leftNode = $item('.overlay-container');
- const link = leftNode
+ const relativeLink = leftNode
.find('a')
.first()
.attr('href');
@@ -29,15 +30,15 @@ module.exports = async (ctx) => {
.first()
.text();
const imgUrl = leftNode
- .find('.img')
+ .find('img')
.first()
- .attr('href');
+ .attr('src');
const rightNode = $item('.home-info-content');
const infoType = rightNode.find('.user-name').contents()[0].data;
const infoTitle = rightNode.find('.user-content').text();
return {
title: infoTitle,
- link,
+ link: `${baseUrl}/${relativeLink}`,
category: infoType,
description: [`类型:${typeName}`, infoTitle, `更新内容: ${infoType}`, `
`].join('
'),
};
@@ -52,7 +53,7 @@ module.exports = async (ctx) => {
const title = `手办维基 - 情报 - ${typeToLabel[type]}`;
ctx.state.data = {
title,
- link: `https://www.hpoi.net/user/home?type=info&catType=${type}`,
+ link: `${baseUrl}/user/home?type=info&catType=${type}`,
description: title,
item: items,
};