feat(weibo): 增加外部 CK 账号 CRUD 与生命周期

This commit is contained in:
yml2213
2026-11-08 11:07:23 +08:00
parent dd3508d614
commit a0afa430ec
11 changed files with 611 additions and 10 deletions
+22
View File
@@ -17,6 +17,7 @@ export const weiboApi = {
listAccounts: (params: {
search?: string;
bind_status?: string;
enabled?: boolean;
page: number;
page_size: number;
}) =>
@@ -24,11 +25,32 @@ export const weiboApi = {
'/weibo/accounts',
{ params },
),
getAccount: (accountId: number) =>
api.get<WeiboAccountItem, WeiboAccountItem>(`/weibo/accounts/${accountId}`),
importCookies: (text: string, tag = '') =>
api.post<WeiboImportResult, WeiboImportResult>('/weibo/accounts/import-cookies', {
text,
tag,
}),
updateAccount: (
accountId: number,
data: { tag?: string; remark?: string },
) =>
api.put<WeiboAccountItem, WeiboAccountItem>(
`/weibo/accounts/${accountId}`,
data,
),
disableAccount: (accountId: number, reason = '') =>
api.post<WeiboAccountItem, WeiboAccountItem>(
`/weibo/accounts/${accountId}/disable`,
{ reason },
),
enableAccount: (accountId: number) =>
api.post<WeiboAccountItem, WeiboAccountItem>(
`/weibo/accounts/${accountId}/enable`,
undefined,
{ timeout: 120000 },
),
refreshAccount: (accountId: number) =>
api.post<WeiboAccountItem, WeiboAccountItem>(
`/weibo/accounts/${accountId}/refresh`,