feat(weibo): 拆分账号管理与个人工作台

This commit is contained in:
yml2213
2026-11-08 16:26:53 +08:00
parent 5d6325d74c
commit d566518478
13 changed files with 1307 additions and 93 deletions
+2 -1
View File
@@ -107,7 +107,8 @@ function AppContent() {
<Route path="huya/elite" element={lazyRoute(<HuyaElitePage />)} />
<Route path="huya/collab" element={lazyRoute(<HuyaCollabPage />)} />
<Route path="huya/browser-exchange" element={lazyRoute(<HuyaBrowserExchangePage />)} />
<Route path="weibo/accounts" element={lazyRoute(<WeiboAccountsPage />)} />
<Route path="weibo/accounts" element={lazyRoute(<WeiboAccountsPage mode="management" />)} />
<Route path="weibo/workbench" element={lazyRoute(<WeiboAccountsPage mode="workbench" />)} />
<Route path="weibo/collab" element={lazyRoute(<WeiboCollabPage />)} />
<Route path="yyb/recharge" element={lazyRoute(<YybRechargePage />)} />
<Route path="proxy" element={lazyRoute(<ProxyPage />)} />
+11
View File
@@ -807,6 +807,17 @@ export interface WeiboAccountCkResult {
ck_text: string;
}
export interface WeiboWorkbenchMutationResult {
account_ids: number[];
success: boolean;
}
export interface WeiboBatchTagResult {
updated: number;
tag: string;
success: boolean;
}
export interface WeiboGoodsItem {
id: number;
goods_name: string;
+37
View File
@@ -4,6 +4,7 @@ import type {
PaginatedResponse,
WeiboAccountItem,
WeiboAccountCkResult,
WeiboBatchTagResult,
WeiboBindQrResult,
WeiboExchangeRecordsResult,
WeiboExchangeResult,
@@ -12,6 +13,7 @@ import type {
WeiboPointHistoryResult,
WeiboRechargeOrderResult,
WeiboImportResult,
WeiboWorkbenchMutationResult,
} from './types';
export const weiboApi = {
@@ -60,6 +62,41 @@ export const weiboApi = {
api.post<WeiboAccountCkResult, WeiboAccountCkResult>(
`/weibo/accounts/${accountId}/ck/copy`,
),
batchTagAccounts: (ids: number[], tag: string) =>
api.post<WeiboBatchTagResult, WeiboBatchTagResult>(
'/weibo/accounts/batch-tag',
{ ids, tag },
),
listWorkbenchAccounts: (params: {
search?: string;
bind_status?: string;
enabled?: boolean;
page: number;
page_size: number;
}) =>
api.get<PaginatedResponse<WeiboAccountItem>, PaginatedResponse<WeiboAccountItem>>(
'/weibo/workbench/accounts',
{ params },
),
listWorkbenchPool: (params: {
search?: string;
page: number;
page_size: number;
}) =>
api.get<PaginatedResponse<WeiboAccountItem>, PaginatedResponse<WeiboAccountItem>>(
'/weibo/workbench/pool',
{ params },
),
addWorkbenchAccounts: (accountIds: number[]) =>
api.post<WeiboWorkbenchMutationResult, WeiboWorkbenchMutationResult>(
'/weibo/workbench/accounts',
{ account_ids: accountIds },
),
removeWorkbenchAccounts: (accountIds: number[]) =>
api.post<WeiboWorkbenchMutationResult, WeiboWorkbenchMutationResult>(
'/weibo/workbench/accounts/remove',
{ account_ids: accountIds },
),
bindQrcodes: (accountId: number, channel: 'wx' | 'qq') =>
api.post<WeiboBindQrResult, WeiboBindQrResult>(
`/weibo/accounts/${accountId}/bind-qrcodes`,
+4 -2
View File
@@ -8,7 +8,6 @@ import {
SunOutlined, MoonOutlined, DesktopOutlined, GiftOutlined, ApartmentOutlined, MobileOutlined, ShoppingCartOutlined,
BookOutlined, TrophyOutlined, ShopOutlined, GlobalOutlined,
SafetyCertificateOutlined, FileSearchOutlined, RobotOutlined, FileExcelOutlined,
MessageOutlined,
} from '@ant-design/icons';
import { useNavigate, useLocation, Outlet } from 'react-router-dom';
import { getUser, clearAuth, type AuthUser } from '../store/auth';
@@ -127,7 +126,10 @@ export default function MainLayout({ onLogout }: { onLogout?: () => void }) {
}
if (can('weibo:view')) {
weiboItems.push({ key: '/weibo/accounts', label: '账号与绑定', icon: <MessageOutlined /> });
weiboItems.push({ key: '/weibo/accounts', label: '账号管理', icon: <UserOutlined /> });
}
if (can('weibo:workbench')) {
weiboItems.push({ key: '/weibo/workbench', label: '微博工作台', icon: <DesktopOutlined /> });
}
if (can('weibo:collab:view')) {
weiboItems.push({ key: '/weibo/collab', label: '外部单协作', icon: <FileExcelOutlined /> });
File diff suppressed because it is too large Load Diff