Skip to content

Commit

Permalink
feat(routes): 增加对标签关注的处理逻辑 (DIYgod#18231)
Browse files Browse the repository at this point in the history
  • Loading branch information
CaoMeiYouRen authored Jan 27, 2025
1 parent c5d8650 commit b4bc35a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/routes/juejin/dynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function handler(ctx) {
const username = user.user_name;

const items = list.map((e) => {
const { target_type, target_data, action, time } = e; // action: 0.发布文章;1.点赞文章;2.发布沸点;3.点赞沸点;4.关注用户
const { target_type, target_data, action, time } = e; // action: 0.发布文章;1.点赞文章;2.发布沸点;3.点赞沸点;4.关注用户;5.关注标签
let title: string | undefined;
let description: string | undefined;
let pubDate: Date | undefined;
Expand Down Expand Up @@ -90,6 +90,16 @@ async function handler(ctx) {
pubDate = parseDate(time * 1000);
break;
}
case 'tag': {
// 关注标签
const { tag_name } = target_data;
title = `${username} 关注了标签 ${tag_name}`;
description = tag_name;
category = [tag_name];
link = `https://juejin.cn/tag/${encodeURIComponent(tag_name)}`;
pubDate = parseDate(time * 1000);
break;
}
default:
break;
}
Expand Down

0 comments on commit b4bc35a

Please sign in to comment.