feat(weibo): 增加外部 CK 账号 CRUD 与生命周期
This commit is contained in:
@@ -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`,
|
||||
|
||||
Reference in New Issue
Block a user