feat(monitor): 粘贴视频链接换出博主主页
运营手上常常只有一条作品的分享链接,可监控任务认的是主页里的 sec_uid。 - 从整段分享文案里抠链接(链接前后都是字,按行切切不开),短链先展开, 再从中取作品 id,最后用详情接口换 author.sec_uid - 一次最多 20 条,串行 + 0.4 秒间隔;单条失败只在那一条上报错,不连累整批 - normalize_aweme 补上 creator_id:哈希拼不出主页地址,顺带让以后入库的 抖音作品也带主页链接 - 监控页左上角「视频转主页」,支持逐条复制和一键复制全部(http 下没有 navigator.clipboard,走 execCommand 兜底)
This commit is contained in:
@@ -438,6 +438,16 @@ export function useSendDailyDigest() {
|
||||
})
|
||||
}
|
||||
|
||||
// --- 视频链接 → 博主主页 ---------------------------------------------------
|
||||
|
||||
export function useResolveVideoLinks() {
|
||||
return useMutation({
|
||||
mutationFn: async (text: string) => (await monitorApi.resolveVideoLinks(text)).data,
|
||||
// 单条失败在结果里各自有 error,这里只管整批都没走到的情况(网络、鉴权)。
|
||||
onError: (error: Error) => toast.error(`解析失败:${error.message}`),
|
||||
})
|
||||
}
|
||||
|
||||
// --- 博主备注 --------------------------------------------------------------
|
||||
|
||||
export function useSetCreatorAlias() {
|
||||
|
||||
Reference in New Issue
Block a user