diff --git a/src/views/accountpool/cursor/index.vue b/src/views/accountpool/cursor/index.vue index b1d256d..7432465 100644 --- a/src/views/accountpool/cursor/index.vue +++ b/src/views/accountpool/cursor/index.vue @@ -18,6 +18,7 @@ const editMode = ref('single'); const detailVisible = ref(false); const extractVisible = ref(false); const extractTargetRow = ref(null); +const apiDocVisible = ref(false); const query = reactive({ keyword: '', @@ -26,16 +27,15 @@ const query = reactive({ const activeTypeTab = ref('all'); const extractForm = reactive({ - platform: 'local', // local | xianyu - type: 'account', // account | tk | account_tk + platform: 'local', + type: 'account', }); -const detailRow = ref(null); - const tableData = ref([]); const total = ref(0); const selectedRows = ref([]); +const detailRow = ref(null); const pagination = reactive({ page: 1, pageSize: 30, @@ -196,9 +196,20 @@ function typeText(type) { return 'Token'; } +const PLATFORM_MAP = { + local: { label: '本地', type: 'info' }, + xianyu: { label: '闲鱼', type: 'warning' }, + pinduoduo: { label: '拼多多', type: 'danger' }, + jingdong: { label: '京东', type: 'primary' }, + douyin: { label: '抖音', type: 'success' }, +}; + function platformText(platform) { - if (!platform) return '-'; - return platform === 'local' ? '本地' : '闲鱼'; + return PLATFORM_MAP[platform]?.label || (platform || '-'); +} + +function platformTagType(platform) { + return PLATFORM_MAP[platform]?.type || 'info'; } function normalizeRow(raw) { @@ -247,6 +258,81 @@ async function fetchList() { onMounted(() => { fetchList(); }); + +// ---- 接口说明数据 ---- +const BASE_URL = 'https://api.yunzer.cn'; + +const paramDocs = [ + { name: 'type', required: true, desc: '来源平台,用于标记本次提取来自哪个渠道', values: 'xianyu / taobao / pinduoduo / jingdong / local' }, + { name: 'module', required: true, desc: '号池模块,指定从哪个产品的号池提取', values: 'cursor / windsurf / krio' }, + { name: 'data_type', required: false, desc: '账号类型,不传则提取任意类型', values: 'account / tk / account_tk' }, +]; + +const platformDocs = [ + { value: 'xianyu', label: '闲鱼', desc: '闲鱼平台发货调用' }, + { value: 'pinduoduo', label: '拼多多', desc: '拼多多平台发货调用' }, + { value: 'jingdong', label: '京东', desc: '京东平台发货调用' }, + { value: 'douyin', label: '抖音', desc: '抖音平台发货调用' }, + { value: 'local', label: '本地', desc: '本地手动调用' }, +]; + +const moduleDocs = [ + { value: 'cursor', label: 'Cursor', desc: 'Cursor 号池' }, + { value: 'windsurf', label: 'Windsurf', desc: 'Windsurf 号池' }, + { value: 'krio', label: 'Krio', desc: 'Krio 号池' }, +]; + +const examples = [ + { label: '闲鱼 · 提取 Cursor Token', url: `${BASE_URL}/api/getcard?type=xianyu&module=cursor&data_type=tk` }, + { label: '拼多多 · 提取 Cursor 账号密码', url: `${BASE_URL}/api/getcard?type=pinduoduo&module=cursor&data_type=account` }, + { label: '京东 · 提取 Windsurf 任意类型', url: `${BASE_URL}/api/getcard?type=jingdong&module=windsurf` }, + { label: '抖音 · 提取 Krio Token', url: `${BASE_URL}/api/getcard?type=douyin&module=krio&data_type=tk` }, +]; + +const successResp = `// 账号密码类型(data_type=account) +{ + "code": 200, + "msg": "success", + "data": { + "type": "account", + "account": "user@example.com", + "password": "your_password" + } +} + +// 账号密码+Token 类型(data_type=account_tk) +{ + "code": 200, + "msg": "success", + "data": { + "type": "account_tk", + "account": "user@example.com", + "password": "your_password", + "token": "eyJhbGciOiJIUzI1NiIs..." + } +} + +// 纯 Token 类型(data_type=tk) +{ + "code": 200, + "msg": "success", + "data": { + "type": "tk", + "token": "eyJhbGciOiJIUzI1NiIs..." + } +}`; + +const errorResp = `// 无可用卡密 +{ "code": 404, "msg": "暂无可用卡密" } + +// 参数错误 +{ "code": 400, "msg": "缺少参数 type(来源平台)" }`; + +function copyText(text) { + navigator.clipboard.writeText(text).then(() => { + ElMessage.success('已复制'); + }); +} - - + + - +