Skip to content

Commit b4bc35a

Browse files
authored
feat(routes): 增加对标签关注的处理逻辑 (#18231)
1 parent c5d8650 commit b4bc35a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/routes/juejin/dynamic.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async function handler(ctx) {
4040
const username = user.user_name;
4141

4242
const items = list.map((e) => {
43-
const { target_type, target_data, action, time } = e; // action: 0.发布文章;1.点赞文章;2.发布沸点;3.点赞沸点;4.关注用户
43+
const { target_type, target_data, action, time } = e; // action: 0.发布文章;1.点赞文章;2.发布沸点;3.点赞沸点;4.关注用户;5.关注标签
4444
let title: string | undefined;
4545
let description: string | undefined;
4646
let pubDate: Date | undefined;
@@ -90,6 +90,16 @@ async function handler(ctx) {
9090
pubDate = parseDate(time * 1000);
9191
break;
9292
}
93+
case 'tag': {
94+
// 关注标签
95+
const { tag_name } = target_data;
96+
title = `${username} 关注了标签 ${tag_name}`;
97+
description = tag_name;
98+
category = [tag_name];
99+
link = `https://juejin.cn/tag/${encodeURIComponent(tag_name)}`;
100+
pubDate = parseDate(time * 1000);
101+
break;
102+
}
93103
default:
94104
break;
95105
}

0 commit comments

Comments
 (0)