refactor(web): 强制同步按钮直调竞品 sync API,移除自有账号执行身份依赖
douyin-release-gate / verify (push) Failing after 3m43s

竞品同步已改用匿名浏览器,前端不再自动挑选自有账号作为执行身份
This commit is contained in:
2026-09-27 15:43:08 +08:00
parent 221ed65e32
commit d1aae0a60f
3 changed files with 10 additions and 21 deletions
-13
View File
@@ -1,7 +1,6 @@
// 领域 API 层:资源路径与语义逐一对照 web.archived/src/shared/api/dataProvider.js。
// 全部经由 requestErrorConfig.request(Basic Auth + 401 全局登出)。
import { AUTH_STORAGE_KEY, RequestError, jsonOptions, request, unauthorized } from '@/requestErrorConfig';
import { isCollectionAccount, platformLabel } from '@/utils/helpers';
export const resourcePaths = {
browsers: '/browsers',
@@ -150,18 +149,6 @@ export function creatorGet(path: string) {
return request(path);
}
// 监控账号同步:自动挑选可用的自有采集账号(登录且授权)作为执行身份。
export async function syncCompetitorAuto(competitor: { id: string; platform: string }): Promise<void> {
const result = await getList({ resource: 'creator-accounts' });
const account = (result.data ?? []).find(
(candidate: any) => candidate.platform === competitor.platform && isCollectionAccount(candidate),
);
if (!account) {
throw new Error(`没有可用于同步${platformLabel(competitor.platform)}监控账号的已登录自有账号。`);
}
await creatorAction(`/creator/competitors/${encodeURIComponent(competitor.id)}/sync`, { account_id: account.id });
}
export function creatorUpdate(path: string, data: unknown) {
return request(path, jsonOptions('PUT', data));
}