merge: resolve conflicts
This commit is contained in:
parent
19828ea396
commit
f25aaaa028
@ -1,38 +1,53 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
|
<<<<<<< Updated upstream
|
||||||
import { computed, onMounted, reactive, ref, watch } from 'vue';
|
import { computed, onMounted, reactive, ref, watch } from 'vue';
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import Edit from './components/edit.vue';
|
import Edit from './components/edit.vue';
|
||||||
import DetailDialog from './components/detail.vue';
|
import DetailDialog from './components/detail.vue';
|
||||||
import ExtractDialog from './components/extract.vue';
|
import ExtractDialog from './components/extract.vue';
|
||||||
|
=======
|
||||||
|
import { computed, onMounted, reactive, ref, watch } from "vue";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
import Edit from "./components/edit.vue";
|
||||||
|
>>>>>>> Stashed changes
|
||||||
import {
|
import {
|
||||||
addAccountPool,
|
addAccountPool,
|
||||||
batchAddAccountPool,
|
batchAddAccountPool,
|
||||||
extractAccountPool,
|
extractAccountPool,
|
||||||
getAccountPoolDetail,
|
getAccountPoolDetail,
|
||||||
getAccountPoolList,
|
getAccountPoolList,
|
||||||
|
<<<<<<< Updated upstream
|
||||||
updateAccountPoolRemark,
|
updateAccountPoolRemark,
|
||||||
} from '@/api/accountPool';
|
} from '@/api/accountPool';
|
||||||
|
=======
|
||||||
|
} from "@/api/accountPool";
|
||||||
|
>>>>>>> Stashed changes
|
||||||
|
|
||||||
const moduleKey = 'cursor';
|
const moduleKey = "cursor";
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const editVisible = ref(false);
|
const editVisible = ref(false);
|
||||||
const editMode = ref('single');
|
const editMode = ref("single");
|
||||||
const detailVisible = ref(false);
|
const detailVisible = ref(false);
|
||||||
const extractVisible = ref(false);
|
const extractVisible = ref(false);
|
||||||
const extractTargetRow = ref(null);
|
const extractTargetRow = ref(null);
|
||||||
const apiDocVisible = ref(false);
|
const apiDocVisible = ref(false);
|
||||||
|
|
||||||
const query = reactive({
|
const query = reactive({
|
||||||
keyword: '',
|
keyword: "",
|
||||||
status: '',
|
status: "",
|
||||||
});
|
});
|
||||||
const activeTypeTab = ref('all');
|
const activeTypeTab = ref("all");
|
||||||
|
|
||||||
const extractForm = reactive({
|
const extractForm = reactive({
|
||||||
|
<<<<<<< Updated upstream
|
||||||
platform: 'local',
|
platform: 'local',
|
||||||
type: 'account',
|
type: 'account',
|
||||||
remark: '',
|
remark: '',
|
||||||
|
=======
|
||||||
|
platform: "local",
|
||||||
|
type: "account",
|
||||||
|
>>>>>>> Stashed changes
|
||||||
});
|
});
|
||||||
|
|
||||||
const tableData = ref([]);
|
const tableData = ref([]);
|
||||||
@ -49,16 +64,16 @@ const pagination = reactive({
|
|||||||
const pagedList = computed(() => tableData.value);
|
const pagedList = computed(() => tableData.value);
|
||||||
|
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
query.keyword = '';
|
query.keyword = "";
|
||||||
query.status = '';
|
query.status = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
const typeTabs = computed(() => {
|
const typeTabs = computed(() => {
|
||||||
return [
|
return [
|
||||||
{ label: '全部', value: 'all' },
|
{ label: "全部", value: "all" },
|
||||||
{ label: '账号密码', value: 'account' },
|
{ label: "账号密码", value: "account" },
|
||||||
{ label: '账号密码+Token', value: 'account_tk' },
|
{ label: "账号密码+Token", value: "account_tk" },
|
||||||
{ label: 'Token', value: 'tk' },
|
{ label: "Token", value: "tk" },
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -67,21 +82,32 @@ watch(
|
|||||||
() => {
|
() => {
|
||||||
pagination.page = 1;
|
pagination.page = 1;
|
||||||
fetchList();
|
fetchList();
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => [pagination.page, pagination.pageSize],
|
() => [pagination.page, pagination.pageSize],
|
||||||
() => {
|
() => {
|
||||||
fetchList();
|
fetchList();
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
function openAddDialog(mode = 'single') {
|
function openAddDialog(mode = "single") {
|
||||||
editMode.value = mode;
|
editMode.value = mode;
|
||||||
editVisible.value = true;
|
editVisible.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< Updated upstream
|
||||||
|
=======
|
||||||
|
function nowText() {
|
||||||
|
const d = new Date();
|
||||||
|
const p = (v) => String(v).padStart(2, "0");
|
||||||
|
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(
|
||||||
|
d.getHours(),
|
||||||
|
)}:${p(d.getMinutes())}:${p(d.getSeconds())}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
>>>>>>> Stashed changes
|
||||||
async function saveRows(rows) {
|
async function saveRows(rows) {
|
||||||
if (!rows.length) return;
|
if (!rows.length) return;
|
||||||
if (rows.length === 1) {
|
if (rows.length === 1) {
|
||||||
@ -96,7 +122,7 @@ async function handleEditSubmit(payload) {
|
|||||||
try {
|
try {
|
||||||
await saveRows(payload.rows || []);
|
await saveRows(payload.rows || []);
|
||||||
ElMessage.success(
|
ElMessage.success(
|
||||||
payload.mode === 'batch' ? '批量添加成功' : '账号添加成功'
|
payload.mode === "batch" ? "批量添加成功" : "账号添加成功",
|
||||||
);
|
);
|
||||||
await fetchList();
|
await fetchList();
|
||||||
} finally {
|
} finally {
|
||||||
@ -113,7 +139,7 @@ function openDetail(row) {
|
|||||||
getAccountPoolDetail(moduleKey, row.id)
|
getAccountPoolDetail(moduleKey, row.id)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res?.code !== 200) {
|
if (res?.code !== 200) {
|
||||||
ElMessage.error(res?.msg || '获取详情失败');
|
ElMessage.error(res?.msg || "获取详情失败");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
detailRow.value = normalizeRow(res.data || {});
|
detailRow.value = normalizeRow(res.data || {});
|
||||||
@ -124,9 +150,19 @@ function openDetail(row) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< Updated upstream
|
||||||
|
=======
|
||||||
|
function openExtractDialog() {
|
||||||
|
extractTargetRow.value = null;
|
||||||
|
extractForm.platform = "local";
|
||||||
|
extractForm.type = "account";
|
||||||
|
extractVisible.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
>>>>>>> Stashed changes
|
||||||
function openExtractByRow(row) {
|
function openExtractByRow(row) {
|
||||||
extractTargetRow.value = row;
|
extractTargetRow.value = row;
|
||||||
extractForm.platform = 'local';
|
extractForm.platform = "local";
|
||||||
extractForm.type = row.type;
|
extractForm.type = row.type;
|
||||||
extractForm.remark = row.remark || '';
|
extractForm.remark = row.remark || '';
|
||||||
extractVisible.value = true;
|
extractVisible.value = true;
|
||||||
@ -137,7 +173,7 @@ async function handleExtract() {
|
|||||||
try {
|
try {
|
||||||
const target = extractTargetRow.value;
|
const target = extractTargetRow.value;
|
||||||
if (!target) {
|
if (!target) {
|
||||||
ElMessage.warning('未找到提取目标');
|
ElMessage.warning("未找到提取目标");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const res = await extractAccountPool(moduleKey, {
|
const res = await extractAccountPool(moduleKey, {
|
||||||
@ -147,10 +183,10 @@ async function handleExtract() {
|
|||||||
remark: extractForm.remark || '',
|
remark: extractForm.remark || '',
|
||||||
});
|
});
|
||||||
if (res?.code !== 200) {
|
if (res?.code !== 200) {
|
||||||
ElMessage.error(res?.msg || '提取失败');
|
ElMessage.error(res?.msg || "提取失败");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ElMessage.success('提取成功');
|
ElMessage.success("提取成功");
|
||||||
extractVisible.value = false;
|
extractVisible.value = false;
|
||||||
await fetchList();
|
await fetchList();
|
||||||
} finally {
|
} finally {
|
||||||
@ -179,7 +215,7 @@ async function handleSaveRemark(payload) {
|
|||||||
|
|
||||||
function markExtractForSelected() {
|
function markExtractForSelected() {
|
||||||
if (!selectedRows.value.length) {
|
if (!selectedRows.value.length) {
|
||||||
ElMessage.warning('请先选择数据');
|
ElMessage.warning("请先选择数据");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
@ -188,12 +224,12 @@ function markExtractForSelected() {
|
|||||||
extractAccountPool(moduleKey, {
|
extractAccountPool(moduleKey, {
|
||||||
id: row.id,
|
id: row.id,
|
||||||
type: row.type,
|
type: row.type,
|
||||||
platform: 'local',
|
platform: "local",
|
||||||
})
|
}),
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
ElMessage.success('批量提取成功');
|
ElMessage.success("批量提取成功");
|
||||||
fetchList();
|
fetchList();
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
@ -202,30 +238,34 @@ function markExtractForSelected() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function typeText(type) {
|
function typeText(type) {
|
||||||
if (type === 'account') return '账号密码';
|
if (type === "account") return "账号密码";
|
||||||
if (type === 'account_tk') return '账号密码+Token';
|
if (type === "account_tk") return "账号密码+Token";
|
||||||
return 'Token';
|
return "Token";
|
||||||
}
|
}
|
||||||
|
|
||||||
const tooltipOpts = {
|
const tooltipOpts = {
|
||||||
popperClass: 'pool-tooltip',
|
popperClass: "pool-tooltip",
|
||||||
popperStyle: { maxWidth: '600px', wordBreak: 'break-all', whiteSpace: 'pre-wrap' },
|
popperStyle: {
|
||||||
|
maxWidth: "600px",
|
||||||
|
wordBreak: "break-all",
|
||||||
|
whiteSpace: "pre-wrap",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const PLATFORM_MAP = {
|
const PLATFORM_MAP = {
|
||||||
local: { label: '本地', type: 'info' },
|
local: { label: "本地", type: "info" },
|
||||||
xianyu: { label: '闲鱼', type: 'warning' },
|
xianyu: { label: "闲鱼", type: "warning" },
|
||||||
pinduoduo: { label: '拼多多', type: 'danger' },
|
pinduoduo: { label: "拼多多", type: "danger" },
|
||||||
jingdong: { label: '京东', type: 'primary' },
|
jingdong: { label: "京东", type: "primary" },
|
||||||
douyin: { label: '抖音', type: 'success' },
|
douyin: { label: "抖音", type: "success" },
|
||||||
};
|
};
|
||||||
|
|
||||||
function platformText(platform) {
|
function platformText(platform) {
|
||||||
return PLATFORM_MAP[platform]?.label || (platform || '-');
|
return PLATFORM_MAP[platform]?.label || platform || "-";
|
||||||
}
|
}
|
||||||
|
|
||||||
function platformTagType(platform) {
|
function platformTagType(platform) {
|
||||||
return PLATFORM_MAP[platform]?.type || 'info';
|
return PLATFORM_MAP[platform]?.type || "info";
|
||||||
}
|
}
|
||||||
|
|
||||||
function normalizeRow(raw) {
|
function normalizeRow(raw) {
|
||||||
@ -233,7 +273,7 @@ function normalizeRow(raw) {
|
|||||||
for (const key of keys) {
|
for (const key of keys) {
|
||||||
if (raw?.[key] !== undefined && raw?.[key] !== null) return raw[key];
|
if (raw?.[key] !== undefined && raw?.[key] !== null) return raw[key];
|
||||||
}
|
}
|
||||||
return '';
|
return "";
|
||||||
};
|
};
|
||||||
// 指针类型字段(可能为 null),单独处理
|
// 指针类型字段(可能为 null),单独处理
|
||||||
const pickNullable = (...keys) => {
|
const pickNullable = (...keys) => {
|
||||||
@ -243,23 +283,23 @@ function normalizeRow(raw) {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
const formatTime = (val) => {
|
const formatTime = (val) => {
|
||||||
if (!val) return '';
|
if (!val) return "";
|
||||||
const d = new Date(val);
|
const d = new Date(val);
|
||||||
if (isNaN(d)) return val;
|
if (isNaN(d)) return val;
|
||||||
const p = (v) => String(v).padStart(2, '0');
|
const p = (v) => String(v).padStart(2, "0");
|
||||||
return `${d.getFullYear()}-${p(d.getMonth()+1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}`;
|
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}`;
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
id: pick('id', 'Id', 'ID'),
|
id: pick("id", "Id", "ID"),
|
||||||
type: pick('data_type', 'dataType', 'type'),
|
type: pick("data_type", "dataType", "type"),
|
||||||
account: pick('account', 'Account'),
|
account: pick("account", "Account"),
|
||||||
password: pick('password', 'Password'),
|
password: pick("password", "Password"),
|
||||||
token: pick('token', 'Token'),
|
token: pick("token", "Token"),
|
||||||
remark: pick('remark', 'Remark'),
|
remark: pick("remark", "Remark"),
|
||||||
extracted: Number(pick('is_extracted', 'isExtracted', 'IsExtracted')) === 1,
|
extracted: Number(pick("is_extracted", "isExtracted", "IsExtracted")) === 1,
|
||||||
extractedAt: formatTime(pickNullable('extracted_time', 'extractedAt')),
|
extractedAt: formatTime(pickNullable("extracted_time", "extractedAt")),
|
||||||
extractedPlatform: pickNullable('extracted_platform', 'extractedPlatform'),
|
extractedPlatform: pickNullable("extracted_platform", "extractedPlatform"),
|
||||||
createdAt: formatTime(pick('create_time', 'createdAt')),
|
createdAt: formatTime(pick("create_time", "createdAt")),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -271,10 +311,10 @@ async function fetchList() {
|
|||||||
pageSize: pagination.pageSize,
|
pageSize: pagination.pageSize,
|
||||||
keyword: query.keyword || undefined,
|
keyword: query.keyword || undefined,
|
||||||
status: query.status || undefined,
|
status: query.status || undefined,
|
||||||
type: activeTypeTab.value === 'all' ? undefined : activeTypeTab.value,
|
type: activeTypeTab.value === "all" ? undefined : activeTypeTab.value,
|
||||||
});
|
});
|
||||||
if (res?.code !== 200) {
|
if (res?.code !== 200) {
|
||||||
ElMessage.error(res?.msg || '获取列表失败');
|
ElMessage.error(res?.msg || "获取列表失败");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const list = Array.isArray(res?.data?.list) ? res.data.list : [];
|
const list = Array.isArray(res?.data?.list) ? res.data.list : [];
|
||||||
@ -290,33 +330,60 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// ---- 接口说明数据 ----
|
// ---- 接口说明数据 ----
|
||||||
const BASE_URL = 'https://api.yunzer.cn';
|
const BASE_URL = "https://api.yunzer.cn";
|
||||||
|
|
||||||
const paramDocs = [
|
const paramDocs = [
|
||||||
{ name: 'type', required: true, desc: '来源平台,用于标记本次提取来自哪个渠道', values: 'xianyu / taobao / pinduoduo / jingdong / local' },
|
{
|
||||||
{ name: 'module', required: true, desc: '号池模块,指定从哪个产品的号池提取', values: 'cursor / windsurf / krio' },
|
name: "type",
|
||||||
{ name: 'data_type', required: false, desc: '账号类型,不传则提取任意类型', values: 'account / tk / account_tk' },
|
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 = [
|
const platformDocs = [
|
||||||
{ value: 'xianyu', label: '闲鱼', desc: '闲鱼平台发货调用' },
|
{ value: "xianyu", label: "闲鱼", desc: "闲鱼平台发货调用" },
|
||||||
{ value: 'pinduoduo', label: '拼多多', desc: '拼多多平台发货调用' },
|
{ value: "pinduoduo", label: "拼多多", desc: "拼多多平台发货调用" },
|
||||||
{ value: 'jingdong', label: '京东', desc: '京东平台发货调用' },
|
{ value: "jingdong", label: "京东", desc: "京东平台发货调用" },
|
||||||
{ value: 'douyin', label: '抖音', desc: '抖音平台发货调用' },
|
{ value: "douyin", label: "抖音", desc: "抖音平台发货调用" },
|
||||||
{ value: 'local', label: '本地', desc: '本地手动调用' },
|
{ value: "local", label: "本地", desc: "本地手动调用" },
|
||||||
];
|
];
|
||||||
|
|
||||||
const moduleDocs = [
|
const moduleDocs = [
|
||||||
{ value: 'cursor', label: 'Cursor', desc: 'Cursor 号池' },
|
{ value: "cursor", label: "Cursor", desc: "Cursor 号池" },
|
||||||
{ value: 'windsurf', label: 'Windsurf', desc: 'Windsurf 号池' },
|
{ value: "windsurf", label: "Windsurf", desc: "Windsurf 号池" },
|
||||||
{ value: 'krio', label: 'Krio', desc: 'Krio 号池' },
|
{ value: "krio", label: "Krio", desc: "Krio 号池" },
|
||||||
];
|
];
|
||||||
|
|
||||||
const examples = [
|
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: "闲鱼 · 提取 Cursor Token",
|
||||||
{ label: '京东 · 提取 Windsurf 任意类型', url: `${BASE_URL}/api/getcard?type=jingdong&module=windsurf` },
|
url: `${BASE_URL}/api/getcard?type=xianyu&module=cursor&data_type=tk`,
|
||||||
{ label: '抖音 · 提取 Krio Token', url: `${BASE_URL}/api/getcard?type=douyin&module=krio&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 = `// 纯 Token 类型(data_type=tk)
|
const successResp = `// 纯 Token 类型(data_type=tk)
|
||||||
@ -336,7 +403,7 @@ const errorResp = `// 无可用卡密
|
|||||||
|
|
||||||
function copyText(text) {
|
function copyText(text) {
|
||||||
navigator.clipboard.writeText(text).then(() => {
|
navigator.clipboard.writeText(text).then(() => {
|
||||||
ElMessage.success('已复制');
|
ElMessage.success("已复制");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -345,9 +412,12 @@ function copyCardInfo(row) {
|
|||||||
if (row.account) parts.push(row.account);
|
if (row.account) parts.push(row.account);
|
||||||
if (row.password) parts.push(row.password);
|
if (row.password) parts.push(row.password);
|
||||||
if (row.token) parts.push(row.token);
|
if (row.token) parts.push(row.token);
|
||||||
if (!parts.length) { ElMessage.warning('无可复制内容'); return; }
|
if (!parts.length) {
|
||||||
navigator.clipboard.writeText(parts.join('\n')).then(() => {
|
ElMessage.warning("无可复制内容");
|
||||||
ElMessage.success('已复制');
|
return;
|
||||||
|
}
|
||||||
|
navigator.clipboard.writeText(parts.join("\n")).then(() => {
|
||||||
|
ElMessage.success("已复制");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -369,15 +439,24 @@ function copyCardInfo(row) {
|
|||||||
clearable
|
clearable
|
||||||
class="w-260"
|
class="w-260"
|
||||||
/>
|
/>
|
||||||
<el-select v-model="query.status" placeholder="提取状态" clearable class="w-140">
|
<el-select
|
||||||
|
v-model="query.status"
|
||||||
|
placeholder="提取状态"
|
||||||
|
clearable
|
||||||
|
class="w-140"
|
||||||
|
>
|
||||||
<el-option label="未提取" value="unused" />
|
<el-option label="未提取" value="unused" />
|
||||||
<el-option label="已提取" value="extracted" />
|
<el-option label="已提取" value="extracted" />
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-button @click="resetQuery">重置</el-button>
|
<el-button @click="resetQuery">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="toolbar-right">
|
<div class="toolbar-right">
|
||||||
<el-button type="primary" @click="openAddDialog('single')">添加账号</el-button>
|
<el-button type="primary" @click="openAddDialog('single')"
|
||||||
<el-button type="success" @click="openAddDialog('batch')">批量添加</el-button>
|
>添加账号</el-button
|
||||||
|
>
|
||||||
|
<el-button type="success" @click="openAddDialog('batch')"
|
||||||
|
>批量添加</el-button
|
||||||
|
>
|
||||||
<el-button @click="markExtractForSelected">批量标记提取</el-button>
|
<el-button @click="markExtractForSelected">批量标记提取</el-button>
|
||||||
<el-button @click="apiDocVisible = true">接口说明</el-button>
|
<el-button @click="apiDocVisible = true">接口说明</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -402,40 +481,81 @@ function copyCardInfo(row) {
|
|||||||
>
|
>
|
||||||
<el-table-column type="selection" width="52" />
|
<el-table-column type="selection" width="52" />
|
||||||
<el-table-column prop="id" label="ID" width="80" />
|
<el-table-column prop="id" label="ID" width="80" />
|
||||||
<el-table-column label="账号类型" width="160" align="center">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-tag>{{ typeText(row.type) }}</el-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="account" label="账号" min-width="180" show-overflow-tooltip :tooltip-options="tooltipOpts" />
|
|
||||||
<el-table-column prop="password" label="密码" min-width="160" show-overflow-tooltip :tooltip-options="tooltipOpts">
|
|
||||||
<template #default="{ row }">{{ row.password || '-' }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="Token" min-width="200" show-overflow-tooltip :tooltip-options="tooltipOpts">
|
|
||||||
<template #default="{ row }">{{ row.token || '-' }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="remark" label="备注" min-width="140" show-overflow-tooltip :tooltip-options="tooltipOpts" />
|
|
||||||
<el-table-column label="提取状态" width="100">
|
<el-table-column label="提取状态" width="100">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag :type="row.extracted ? 'success' : 'info'">
|
<el-tag :type="row.extracted ? 'success' : 'info'">
|
||||||
{{ row.extracted ? '已提取' : '未提取' }}
|
{{ row.extracted ? "已提取" : "未提取" }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="extractedAt" label="提取时间" width="180" />
|
|
||||||
<el-table-column label="提取平台" width="120">
|
<el-table-column label="提取平台" width="120">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row.extractedPlatform" :type="platformTagType(row.extractedPlatform)" size="small">
|
<el-tag
|
||||||
|
v-if="row.extractedPlatform"
|
||||||
|
:type="platformTagType(row.extractedPlatform)"
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
{{ platformText(row.extractedPlatform) }}
|
{{ platformText(row.extractedPlatform) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="账号类型" width="160" align="center">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-tag>{{ typeText(row.type) }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="account"
|
||||||
|
label="账号"
|
||||||
|
min-width="180"
|
||||||
|
show-overflow-tooltip
|
||||||
|
:tooltip-options="tooltipOpts"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="password"
|
||||||
|
label="密码"
|
||||||
|
min-width="160"
|
||||||
|
show-overflow-tooltip
|
||||||
|
:tooltip-options="tooltipOpts"
|
||||||
|
>
|
||||||
|
<template #default="{ row }">{{ row.password || "-" }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="Token"
|
||||||
|
min-width="200"
|
||||||
|
show-overflow-tooltip
|
||||||
|
:tooltip-options="tooltipOpts"
|
||||||
|
>
|
||||||
|
<template #default="{ row }">{{ row.token || "-" }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="remark"
|
||||||
|
label="备注"
|
||||||
|
min-width="140"
|
||||||
|
show-overflow-tooltip
|
||||||
|
:tooltip-options="tooltipOpts"
|
||||||
|
/>
|
||||||
|
<el-table-column prop="extractedAt" label="提取时间" width="180" />
|
||||||
<el-table-column label="操作" width="220" fixed="right" align="center">
|
<el-table-column label="操作" width="220" fixed="right" align="center">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button link type="primary" @click="openDetail(row)">详情</el-button>
|
<el-button link type="primary" @click="openDetail(row)"
|
||||||
<el-button link type="warning" :disabled="row.extracted" @click="openExtractByRow(row)">提取</el-button>
|
>详情</el-button
|
||||||
<el-button v-if="row.extracted" link type="success" @click="copyCardInfo(row)">复制</el-button>
|
>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="warning"
|
||||||
|
:disabled="row.extracted"
|
||||||
|
@click="openExtractByRow(row)"
|
||||||
|
>提取</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
v-if="row.extracted"
|
||||||
|
link
|
||||||
|
type="success"
|
||||||
|
@click="copyCardInfo(row)"
|
||||||
|
>复制</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -454,6 +574,7 @@ function copyCardInfo(row) {
|
|||||||
|
|
||||||
<Edit v-model="editVisible" :mode="editMode" @submit="handleEditSubmit" />
|
<Edit v-model="editVisible" :mode="editMode" @submit="handleEditSubmit" />
|
||||||
|
|
||||||
|
<<<<<<< Updated upstream
|
||||||
<DetailDialog
|
<DetailDialog
|
||||||
v-model="detailVisible"
|
v-model="detailVisible"
|
||||||
:row="detailRow"
|
:row="detailRow"
|
||||||
@ -472,11 +593,80 @@ function copyCardInfo(row) {
|
|||||||
@update:remark="(v) => (extractForm.remark = v)"
|
@update:remark="(v) => (extractForm.remark = v)"
|
||||||
@confirm="handleExtract"
|
@confirm="handleExtract"
|
||||||
/>
|
/>
|
||||||
|
=======
|
||||||
|
<el-dialog v-model="detailVisible" title="账号详情" width="560px">
|
||||||
|
<el-descriptions :column="1" border v-if="detailRow">
|
||||||
|
<el-descriptions-item label="ID">{{
|
||||||
|
detailRow.id
|
||||||
|
}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="提取状态">
|
||||||
|
{{ detailRow.extracted ? "已提取" : "未提取" }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="提取平台">
|
||||||
|
<el-tag
|
||||||
|
v-if="detailRow.extractedPlatform"
|
||||||
|
:type="platformTagType(detailRow.extractedPlatform)"
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
{{ platformText(detailRow.extractedPlatform) }}
|
||||||
|
</el-tag>
|
||||||
|
<span v-else>-</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="账号类型">
|
||||||
|
{{ typeText(detailRow.type) }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="账号">
|
||||||
|
{{ detailRow.account || "-" }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="密码">
|
||||||
|
{{ detailRow.password || "-" }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="Token">
|
||||||
|
<span class="token-text">{{ detailRow.token || "-" }}</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="提取时间">
|
||||||
|
{{ detailRow.extractedAt || "-" }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="备注">
|
||||||
|
{{ detailRow.remark || "-" }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog v-model="extractVisible" title="提取账号" width="420px">
|
||||||
|
<el-form label-width="84px">
|
||||||
|
<el-form-item label="提取类型">
|
||||||
|
<el-input :model-value="typeText(extractForm.type)" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="提取平台">
|
||||||
|
<el-select v-model="extractForm.platform" style="width: 100%">
|
||||||
|
<el-option
|
||||||
|
v-for="(v, k) in PLATFORM_MAP"
|
||||||
|
:key="k"
|
||||||
|
:value="k"
|
||||||
|
:label="v.label"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="extractVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" :loading="loading" @click="handleExtract">
|
||||||
|
确认提取
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
>>>>>>> Stashed changes
|
||||||
|
|
||||||
<!-- 接口说明抽屉 -->
|
<!-- 接口说明抽屉 -->
|
||||||
<el-drawer v-model="apiDocVisible" title="提卡接口说明" size="560px" direction="rtl">
|
<el-drawer
|
||||||
|
v-model="apiDocVisible"
|
||||||
|
title="提卡接口说明"
|
||||||
|
size="560px"
|
||||||
|
direction="rtl"
|
||||||
|
>
|
||||||
<div class="api-doc">
|
<div class="api-doc">
|
||||||
<el-alert type="info" :closable="false" style="margin-bottom:16px">
|
<el-alert type="info" :closable="false" style="margin-bottom: 16px">
|
||||||
该接口为对外公开接口,无需登录认证,每次调用自动提取一条未使用的卡密并标记为已提取(不可重复)。
|
该接口为对外公开接口,无需登录认证,每次调用自动提取一条未使用的卡密并标记为已提取(不可重复)。
|
||||||
</el-alert>
|
</el-alert>
|
||||||
|
|
||||||
@ -490,10 +680,15 @@ function copyCardInfo(row) {
|
|||||||
<div class="doc-title">请求参数</div>
|
<div class="doc-title">请求参数</div>
|
||||||
<el-table :data="paramDocs" border size="small">
|
<el-table :data="paramDocs" border size="small">
|
||||||
<el-table-column prop="name" label="参数名" width="120" />
|
<el-table-column prop="name" label="参数名" width="120" />
|
||||||
<el-table-column prop="required" label="必填" width="60" align="center">
|
<el-table-column
|
||||||
|
prop="required"
|
||||||
|
label="必填"
|
||||||
|
width="60"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag :type="row.required ? 'danger' : 'info'" size="small">
|
<el-tag :type="row.required ? 'danger' : 'info'" size="small">
|
||||||
{{ row.required ? '是' : '否' }}
|
{{ row.required ? "是" : "否" }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -508,7 +703,13 @@ function copyCardInfo(row) {
|
|||||||
<div class="example-label">{{ ex.label }}</div>
|
<div class="example-label">{{ ex.label }}</div>
|
||||||
<div class="example-url-wrap">
|
<div class="example-url-wrap">
|
||||||
<code class="example-url">{{ ex.url }}</code>
|
<code class="example-url">{{ ex.url }}</code>
|
||||||
<el-button link type="primary" size="small" @click="copyText(ex.url)">复制</el-button>
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="copyText(ex.url)"
|
||||||
|
>复制</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,32 +1,46 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
|
<<<<<<< Updated upstream
|
||||||
import { computed, onMounted, reactive, ref, watch } from 'vue';
|
import { computed, onMounted, reactive, ref, watch } from 'vue';
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import Edit from './components/edit.vue';
|
import Edit from './components/edit.vue';
|
||||||
import DetailDialog from './components/detail.vue';
|
import DetailDialog from './components/detail.vue';
|
||||||
import ExtractDialog from './components/extract.vue';
|
import ExtractDialog from './components/extract.vue';
|
||||||
|
=======
|
||||||
|
import { computed, onMounted, reactive, ref, watch } from "vue";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
import Edit from "./components/edit.vue";
|
||||||
|
>>>>>>> Stashed changes
|
||||||
import {
|
import {
|
||||||
addAccountPool,
|
addAccountPool,
|
||||||
batchAddAccountPool,
|
batchAddAccountPool,
|
||||||
extractAccountPool,
|
extractAccountPool,
|
||||||
getAccountPoolDetail,
|
getAccountPoolDetail,
|
||||||
getAccountPoolList,
|
getAccountPoolList,
|
||||||
|
<<<<<<< Updated upstream
|
||||||
updateAccountPoolRemark,
|
updateAccountPoolRemark,
|
||||||
} from '@/api/accountPool';
|
} from '@/api/accountPool';
|
||||||
|
=======
|
||||||
|
} from "@/api/accountPool";
|
||||||
|
>>>>>>> Stashed changes
|
||||||
|
|
||||||
const moduleKey = 'krio';
|
const moduleKey = "krio";
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const editVisible = ref(false);
|
const editVisible = ref(false);
|
||||||
const editMode = ref('single');
|
const editMode = ref("single");
|
||||||
const detailVisible = ref(false);
|
const detailVisible = ref(false);
|
||||||
const extractVisible = ref(false);
|
const extractVisible = ref(false);
|
||||||
const extractTargetRow = ref(null);
|
const extractTargetRow = ref(null);
|
||||||
const apiDocVisible = ref(false);
|
const apiDocVisible = ref(false);
|
||||||
|
|
||||||
const query = reactive({ keyword: '', status: '' });
|
const query = reactive({ keyword: "", status: "" });
|
||||||
const activeTypeTab = ref('all');
|
const activeTypeTab = ref("all");
|
||||||
|
|
||||||
|
<<<<<<< Updated upstream
|
||||||
const extractForm = reactive({ platform: 'local', type: 'account', remark: '' });
|
const extractForm = reactive({ platform: 'local', type: 'account', remark: '' });
|
||||||
|
=======
|
||||||
|
const extractForm = reactive({ platform: "local", type: "account" });
|
||||||
|
>>>>>>> Stashed changes
|
||||||
|
|
||||||
const tableData = ref([]);
|
const tableData = ref([]);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
@ -38,31 +52,42 @@ const pagination = reactive({ page: 1, pageSize: 30 });
|
|||||||
const pagedList = computed(() => tableData.value);
|
const pagedList = computed(() => tableData.value);
|
||||||
|
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
query.keyword = '';
|
query.keyword = "";
|
||||||
query.status = '';
|
query.status = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
const typeTabs = computed(() => [
|
const typeTabs = computed(() => [
|
||||||
{ label: '全部', value: 'all' },
|
{ label: "全部", value: "all" },
|
||||||
{ label: '账号密码', value: 'account' },
|
{ label: "账号密码", value: "account" },
|
||||||
{ label: '账号密码+Token', value: 'account_tk' },
|
{ label: "账号密码+Token", value: "account_tk" },
|
||||||
{ label: 'Token', value: 'tk' },
|
{ label: "Token", value: "tk" },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
watch(() => [query.keyword, query.status, activeTypeTab.value], () => {
|
watch(
|
||||||
|
() => [query.keyword, query.status, activeTypeTab.value],
|
||||||
|
() => {
|
||||||
pagination.page = 1;
|
pagination.page = 1;
|
||||||
fetchList();
|
fetchList();
|
||||||
});
|
},
|
||||||
watch(() => [pagination.page, pagination.pageSize], () => { fetchList(); });
|
);
|
||||||
|
watch(
|
||||||
|
() => [pagination.page, pagination.pageSize],
|
||||||
|
() => {
|
||||||
|
fetchList();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
function openAddDialog(mode = 'single') {
|
function openAddDialog(mode = "single") {
|
||||||
editMode.value = mode;
|
editMode.value = mode;
|
||||||
editVisible.value = true;
|
editVisible.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function saveRows(rows) {
|
async function saveRows(rows) {
|
||||||
if (!rows.length) return;
|
if (!rows.length) return;
|
||||||
if (rows.length === 1) { await addAccountPool(moduleKey, rows[0]); return; }
|
if (rows.length === 1) {
|
||||||
|
await addAccountPool(moduleKey, rows[0]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
await batchAddAccountPool(moduleKey, rows);
|
await batchAddAccountPool(moduleKey, rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,27 +95,38 @@ async function handleEditSubmit(payload) {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
await saveRows(payload.rows || []);
|
await saveRows(payload.rows || []);
|
||||||
ElMessage.success(payload.mode === 'batch' ? '批量添加成功' : '账号添加成功');
|
ElMessage.success(
|
||||||
|
payload.mode === "batch" ? "批量添加成功" : "账号添加成功",
|
||||||
|
);
|
||||||
await fetchList();
|
await fetchList();
|
||||||
} finally { loading.value = false; }
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSelectionChange(rows) { selectedRows.value = rows; }
|
function handleSelectionChange(rows) {
|
||||||
|
selectedRows.value = rows;
|
||||||
|
}
|
||||||
|
|
||||||
function openDetail(row) {
|
function openDetail(row) {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
getAccountPoolDetail(moduleKey, row.id)
|
getAccountPoolDetail(moduleKey, row.id)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res?.code !== 200) { ElMessage.error(res?.msg || '获取详情失败'); return; }
|
if (res?.code !== 200) {
|
||||||
|
ElMessage.error(res?.msg || "获取详情失败");
|
||||||
|
return;
|
||||||
|
}
|
||||||
detailRow.value = normalizeRow(res.data || {});
|
detailRow.value = normalizeRow(res.data || {});
|
||||||
detailVisible.value = true;
|
detailVisible.value = true;
|
||||||
})
|
})
|
||||||
.finally(() => { loading.value = false; });
|
.finally(() => {
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function openExtractByRow(row) {
|
function openExtractByRow(row) {
|
||||||
extractTargetRow.value = row;
|
extractTargetRow.value = row;
|
||||||
extractForm.platform = 'local';
|
extractForm.platform = "local";
|
||||||
extractForm.type = row.type;
|
extractForm.type = row.type;
|
||||||
extractForm.remark = row.remark || '';
|
extractForm.remark = row.remark || '';
|
||||||
extractVisible.value = true;
|
extractVisible.value = true;
|
||||||
@ -100,15 +136,29 @@ async function handleExtract() {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
const target = extractTargetRow.value;
|
const target = extractTargetRow.value;
|
||||||
if (!target) { ElMessage.warning('未找到提取目标'); return; }
|
if (!target) {
|
||||||
|
ElMessage.warning("未找到提取目标");
|
||||||
|
return;
|
||||||
|
}
|
||||||
const res = await extractAccountPool(moduleKey, {
|
const res = await extractAccountPool(moduleKey, {
|
||||||
|
<<<<<<< Updated upstream
|
||||||
id: target.id, type: target.type, platform: extractForm.platform, remark: extractForm.remark || '',
|
id: target.id, type: target.type, platform: extractForm.platform, remark: extractForm.remark || '',
|
||||||
|
=======
|
||||||
|
id: target.id,
|
||||||
|
type: target.type,
|
||||||
|
platform: extractForm.platform,
|
||||||
|
>>>>>>> Stashed changes
|
||||||
});
|
});
|
||||||
if (res?.code !== 200) { ElMessage.error(res?.msg || '提取失败'); return; }
|
if (res?.code !== 200) {
|
||||||
ElMessage.success('提取成功');
|
ElMessage.error(res?.msg || "提取失败");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ElMessage.success("提取成功");
|
||||||
extractVisible.value = false;
|
extractVisible.value = false;
|
||||||
await fetchList();
|
await fetchList();
|
||||||
} finally { loading.value = false; }
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleSaveRemark(payload) {
|
async function handleSaveRemark(payload) {
|
||||||
@ -126,44 +176,65 @@ async function handleSaveRemark(payload) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function markExtractForSelected() {
|
function markExtractForSelected() {
|
||||||
if (!selectedRows.value.length) { ElMessage.warning('请先选择数据'); return; }
|
if (!selectedRows.value.length) {
|
||||||
|
ElMessage.warning("请先选择数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
Promise.all(
|
Promise.all(
|
||||||
selectedRows.value.map((row) =>
|
selectedRows.value.map((row) =>
|
||||||
extractAccountPool(moduleKey, { id: row.id, type: row.type, platform: 'local' })
|
extractAccountPool(moduleKey, {
|
||||||
|
id: row.id,
|
||||||
|
type: row.type,
|
||||||
|
platform: "local",
|
||||||
|
}),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
).then(() => { ElMessage.success('批量提取成功'); fetchList(); })
|
.then(() => {
|
||||||
.finally(() => { loading.value = false; });
|
ElMessage.success("批量提取成功");
|
||||||
|
fetchList();
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function typeText(type) {
|
function typeText(type) {
|
||||||
if (type === 'account') return '账号密码';
|
if (type === "account") return "账号密码";
|
||||||
if (type === 'account_tk') return '账号密码+Token';
|
if (type === "account_tk") return "账号密码+Token";
|
||||||
return 'Token';
|
return "Token";
|
||||||
}
|
}
|
||||||
|
|
||||||
const tooltipOpts = {
|
const tooltipOpts = {
|
||||||
popperClass: 'pool-tooltip',
|
popperClass: "pool-tooltip",
|
||||||
popperStyle: { maxWidth: '600px', wordBreak: 'break-all', whiteSpace: 'pre-wrap' },
|
popperStyle: {
|
||||||
|
maxWidth: "600px",
|
||||||
|
wordBreak: "break-all",
|
||||||
|
whiteSpace: "pre-wrap",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const PLATFORM_MAP = {
|
const PLATFORM_MAP = {
|
||||||
local: { label: '本地', type: 'info' },
|
local: { label: "本地", type: "info" },
|
||||||
xianyu: { label: '闲鱼', type: 'warning' },
|
xianyu: { label: "闲鱼", type: "warning" },
|
||||||
pinduoduo: { label: '拼多多', type: 'danger' },
|
pinduoduo: { label: "拼多多", type: "danger" },
|
||||||
jingdong: { label: '京东', type: 'primary' },
|
jingdong: { label: "京东", type: "primary" },
|
||||||
douyin: { label: '抖音', type: 'success' },
|
douyin: { label: "抖音", type: "success" },
|
||||||
};
|
};
|
||||||
|
|
||||||
function platformText(platform) { return PLATFORM_MAP[platform]?.label || (platform || '-'); }
|
function platformText(platform) {
|
||||||
function platformTagType(platform) { return PLATFORM_MAP[platform]?.type || 'info'; }
|
return PLATFORM_MAP[platform]?.label || platform || "-";
|
||||||
|
}
|
||||||
|
function platformTagType(platform) {
|
||||||
|
return PLATFORM_MAP[platform]?.type || "info";
|
||||||
|
}
|
||||||
|
|
||||||
function normalizeRow(raw) {
|
function normalizeRow(raw) {
|
||||||
const pick = (...keys) => {
|
const pick = (...keys) => {
|
||||||
for (const key of keys) {
|
for (const key of keys) {
|
||||||
if (raw?.[key] !== undefined && raw?.[key] !== null) return raw[key];
|
if (raw?.[key] !== undefined && raw?.[key] !== null) return raw[key];
|
||||||
}
|
}
|
||||||
return '';
|
return "";
|
||||||
};
|
};
|
||||||
const pickNullable = (...keys) => {
|
const pickNullable = (...keys) => {
|
||||||
for (const key of keys) {
|
for (const key of keys) {
|
||||||
@ -172,23 +243,23 @@ function normalizeRow(raw) {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
const formatTime = (val) => {
|
const formatTime = (val) => {
|
||||||
if (!val) return '';
|
if (!val) return "";
|
||||||
const d = new Date(val);
|
const d = new Date(val);
|
||||||
if (isNaN(d)) return val;
|
if (isNaN(d)) return val;
|
||||||
const p = (v) => String(v).padStart(2, '0');
|
const p = (v) => String(v).padStart(2, "0");
|
||||||
return `${d.getFullYear()}-${p(d.getMonth()+1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}`;
|
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}`;
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
id: pick('id', 'Id', 'ID'),
|
id: pick("id", "Id", "ID"),
|
||||||
type: pick('data_type', 'dataType', 'type'),
|
type: pick("data_type", "dataType", "type"),
|
||||||
account: pick('account', 'Account'),
|
account: pick("account", "Account"),
|
||||||
password: pick('password', 'Password'),
|
password: pick("password", "Password"),
|
||||||
token: pick('token', 'Token'),
|
token: pick("token", "Token"),
|
||||||
remark: pick('remark', 'Remark'),
|
remark: pick("remark", "Remark"),
|
||||||
extracted: Number(pick('is_extracted', 'isExtracted', 'IsExtracted')) === 1,
|
extracted: Number(pick("is_extracted", "isExtracted", "IsExtracted")) === 1,
|
||||||
extractedAt: formatTime(pickNullable('extracted_time', 'extractedAt')),
|
extractedAt: formatTime(pickNullable("extracted_time", "extractedAt")),
|
||||||
extractedPlatform: pickNullable('extracted_platform', 'extractedPlatform'),
|
extractedPlatform: pickNullable("extracted_platform", "extractedPlatform"),
|
||||||
createdAt: formatTime(pick('create_time', 'createdAt')),
|
createdAt: formatTime(pick("create_time", "createdAt")),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,48 +267,83 @@ async function fetchList() {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
const res = await getAccountPoolList(moduleKey, {
|
const res = await getAccountPoolList(moduleKey, {
|
||||||
page: pagination.page, pageSize: pagination.pageSize,
|
page: pagination.page,
|
||||||
|
pageSize: pagination.pageSize,
|
||||||
keyword: query.keyword || undefined,
|
keyword: query.keyword || undefined,
|
||||||
status: query.status || undefined,
|
status: query.status || undefined,
|
||||||
type: activeTypeTab.value === 'all' ? undefined : activeTypeTab.value,
|
type: activeTypeTab.value === "all" ? undefined : activeTypeTab.value,
|
||||||
});
|
});
|
||||||
if (res?.code !== 200) { ElMessage.error(res?.msg || '获取列表失败'); return; }
|
if (res?.code !== 200) {
|
||||||
|
ElMessage.error(res?.msg || "获取列表失败");
|
||||||
|
return;
|
||||||
|
}
|
||||||
const list = Array.isArray(res?.data?.list) ? res.data.list : [];
|
const list = Array.isArray(res?.data?.list) ? res.data.list : [];
|
||||||
tableData.value = list.map(normalizeRow);
|
tableData.value = list.map(normalizeRow);
|
||||||
total.value = Number(res?.data?.total || 0);
|
total.value = Number(res?.data?.total || 0);
|
||||||
} finally { loading.value = false; }
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => { fetchList(); });
|
onMounted(() => {
|
||||||
|
fetchList();
|
||||||
|
});
|
||||||
|
|
||||||
// ---- 接口说明数据 ----
|
// ---- 接口说明数据 ----
|
||||||
const BASE_URL = 'https://api.yunzer.cn';
|
const BASE_URL = "https://api.yunzer.cn";
|
||||||
|
|
||||||
const paramDocs = [
|
const paramDocs = [
|
||||||
{ name: 'type', required: true, desc: '来源平台,用于标记本次提取来自哪个渠道', values: 'xianyu / pinduoduo / jingdong / douyin / local' },
|
{
|
||||||
{ name: 'module', required: true, desc: '号池模块,指定从哪个产品的号池提取', values: 'cursor / windsurf / krio' },
|
name: "type",
|
||||||
{ name: 'data_type', required: false, desc: '账号类型,不传则提取任意类型', values: 'account / tk / account_tk' },
|
required: true,
|
||||||
|
desc: "来源平台,用于标记本次提取来自哪个渠道",
|
||||||
|
values: "xianyu / pinduoduo / jingdong / douyin / local",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "module",
|
||||||
|
required: true,
|
||||||
|
desc: "号池模块,指定从哪个产品的号池提取",
|
||||||
|
values: "cursor / windsurf / krio",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "data_type",
|
||||||
|
required: false,
|
||||||
|
desc: "账号类型,不传则提取任意类型",
|
||||||
|
values: "account / tk / account_tk",
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const platformDocs = [
|
const platformDocs = [
|
||||||
{ value: 'xianyu', label: '闲鱼', desc: '闲鱼平台发货调用' },
|
{ value: "xianyu", label: "闲鱼", desc: "闲鱼平台发货调用" },
|
||||||
{ value: 'pinduoduo', label: '拼多多', desc: '拼多多平台发货调用' },
|
{ value: "pinduoduo", label: "拼多多", desc: "拼多多平台发货调用" },
|
||||||
{ value: 'jingdong', label: '京东', desc: '京东平台发货调用' },
|
{ value: "jingdong", label: "京东", desc: "京东平台发货调用" },
|
||||||
{ value: 'douyin', label: '抖音', desc: '抖音平台发货调用' },
|
{ value: "douyin", label: "抖音", desc: "抖音平台发货调用" },
|
||||||
{ value: 'local', label: '本地', desc: '本地手动调用' },
|
{ value: "local", label: "本地", desc: "本地手动调用" },
|
||||||
];
|
];
|
||||||
|
|
||||||
const moduleDocs = [
|
const moduleDocs = [
|
||||||
{ value: 'cursor', label: 'Cursor', desc: 'Cursor 号池' },
|
{ value: "cursor", label: "Cursor", desc: "Cursor 号池" },
|
||||||
{ value: 'windsurf', label: 'Windsurf', desc: 'Windsurf 号池' },
|
{ value: "windsurf", label: "Windsurf", desc: "Windsurf 号池" },
|
||||||
{ value: 'krio', label: 'Krio', desc: 'Krio 号池' },
|
{ value: "krio", label: "Krio", desc: "Krio 号池" },
|
||||||
];
|
];
|
||||||
|
|
||||||
const examples = [
|
const examples = [
|
||||||
{ label: '闲鱼 · 提取 Krio Token', url: `${BASE_URL}/api/getcard?type=xianyu&module=krio&data_type=tk` },
|
{
|
||||||
{ label: '拼多多 · 提取 Krio 账号密码', url: `${BASE_URL}/api/getcard?type=pinduoduo&module=krio&data_type=account` },
|
label: "闲鱼 · 提取 Krio Token",
|
||||||
{ label: '京东 · 提取 Cursor 任意类型', url: `${BASE_URL}/api/getcard?type=jingdong&module=cursor` },
|
url: `${BASE_URL}/api/getcard?type=xianyu&module=krio&data_type=tk`,
|
||||||
{ label: '抖音 · 提取 Windsurf Token', url: `${BASE_URL}/api/getcard?type=douyin&module=windsurf&data_type=tk` },
|
},
|
||||||
|
{
|
||||||
|
label: "拼多多 · 提取 Krio 账号密码",
|
||||||
|
url: `${BASE_URL}/api/getcard?type=pinduoduo&module=krio&data_type=account`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "京东 · 提取 Cursor 任意类型",
|
||||||
|
url: `${BASE_URL}/api/getcard?type=jingdong&module=cursor`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "抖音 · 提取 Windsurf Token",
|
||||||
|
url: `${BASE_URL}/api/getcard?type=douyin&module=windsurf&data_type=tk`,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const successResp = `// 纯 Token 类型(data_type=tk)
|
const successResp = `// 纯 Token 类型(data_type=tk)
|
||||||
@ -256,7 +362,9 @@ const errorResp = `// 无可用卡密
|
|||||||
{ "code": 400, "msg": "缺少参数 type(来源平台)" }`;
|
{ "code": 400, "msg": "缺少参数 type(来源平台)" }`;
|
||||||
|
|
||||||
function copyText(text) {
|
function copyText(text) {
|
||||||
navigator.clipboard.writeText(text).then(() => { ElMessage.success('已复制'); });
|
navigator.clipboard.writeText(text).then(() => {
|
||||||
|
ElMessage.success("已复制");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyCardInfo(row) {
|
function copyCardInfo(row) {
|
||||||
@ -264,8 +372,13 @@ function copyCardInfo(row) {
|
|||||||
if (row.account) parts.push(row.account);
|
if (row.account) parts.push(row.account);
|
||||||
if (row.password) parts.push(row.password);
|
if (row.password) parts.push(row.password);
|
||||||
if (row.token) parts.push(row.token);
|
if (row.token) parts.push(row.token);
|
||||||
if (!parts.length) { ElMessage.warning('无可复制内容'); return; }
|
if (!parts.length) {
|
||||||
navigator.clipboard.writeText(parts.join('\n')).then(() => { ElMessage.success('已复制'); });
|
ElMessage.warning("无可复制内容");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
navigator.clipboard.writeText(parts.join("\n")).then(() => {
|
||||||
|
ElMessage.success("已复制");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -278,58 +391,129 @@ function copyCardInfo(row) {
|
|||||||
|
|
||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<div class="toolbar-left">
|
<div class="toolbar-left">
|
||||||
<el-input v-model="query.keyword" placeholder="搜索账号 / token / 备注" clearable class="w-260" />
|
<el-input
|
||||||
<el-select v-model="query.status" placeholder="提取状态" clearable class="w-140">
|
v-model="query.keyword"
|
||||||
|
placeholder="搜索账号 / token / 备注"
|
||||||
|
clearable
|
||||||
|
class="w-260"
|
||||||
|
/>
|
||||||
|
<el-select
|
||||||
|
v-model="query.status"
|
||||||
|
placeholder="提取状态"
|
||||||
|
clearable
|
||||||
|
class="w-140"
|
||||||
|
>
|
||||||
<el-option label="未提取" value="unused" />
|
<el-option label="未提取" value="unused" />
|
||||||
<el-option label="已提取" value="extracted" />
|
<el-option label="已提取" value="extracted" />
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-button @click="resetQuery">重置</el-button>
|
<el-button @click="resetQuery">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="toolbar-right">
|
<div class="toolbar-right">
|
||||||
<el-button type="primary" @click="openAddDialog('single')">添加账号</el-button>
|
<el-button type="primary" @click="openAddDialog('single')"
|
||||||
<el-button type="success" @click="openAddDialog('batch')">批量添加</el-button>
|
>添加账号</el-button
|
||||||
|
>
|
||||||
|
<el-button type="success" @click="openAddDialog('batch')"
|
||||||
|
>批量添加</el-button
|
||||||
|
>
|
||||||
<el-button @click="markExtractForSelected">批量标记提取</el-button>
|
<el-button @click="markExtractForSelected">批量标记提取</el-button>
|
||||||
<el-button @click="apiDocVisible = true">接口说明</el-button>
|
<el-button @click="apiDocVisible = true">接口说明</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-tabs v-model="activeTypeTab" class="type-tabs">
|
<el-tabs v-model="activeTypeTab" class="type-tabs">
|
||||||
<el-tab-pane v-for="tab in typeTabs" :key="tab.value" :label="tab.label" :name="tab.value" />
|
<el-tab-pane
|
||||||
|
v-for="tab in typeTabs"
|
||||||
|
:key="tab.value"
|
||||||
|
:label="tab.label"
|
||||||
|
:name="tab.value"
|
||||||
|
/>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
|
||||||
<el-table :data="pagedList" border stripe style="width: 100%" :loading="loading" @selection-change="handleSelectionChange">
|
<el-table
|
||||||
|
:data="pagedList"
|
||||||
|
border
|
||||||
|
stripe
|
||||||
|
style="width: 100%"
|
||||||
|
:loading="loading"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
<el-table-column type="selection" width="52" />
|
<el-table-column type="selection" width="52" />
|
||||||
<el-table-column prop="id" label="ID" width="80" />
|
<el-table-column prop="id" label="ID" width="80" />
|
||||||
<el-table-column label="账号类型" width="160" align="center">
|
|
||||||
<template #default="{ row }"><el-tag>{{ typeText(row.type) }}</el-tag></template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="account" label="账号" min-width="180" show-overflow-tooltip :tooltip-options="tooltipOpts" />
|
|
||||||
<el-table-column prop="password" label="密码" min-width="160" show-overflow-tooltip :tooltip-options="tooltipOpts">
|
|
||||||
<template #default="{ row }">{{ row.password || '-' }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="Token" min-width="200" show-overflow-tooltip :tooltip-options="tooltipOpts">
|
|
||||||
<template #default="{ row }">{{ row.token || '-' }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="remark" label="备注" min-width="140" show-overflow-tooltip :tooltip-options="tooltipOpts" />
|
|
||||||
<el-table-column label="提取状态" width="100">
|
<el-table-column label="提取状态" width="100">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag :type="row.extracted ? 'success' : 'info'">{{ row.extracted ? '已提取' : '未提取' }}</el-tag>
|
<el-tag :type="row.extracted ? 'success' : 'info'">{{
|
||||||
|
row.extracted ? "已提取" : "未提取"
|
||||||
|
}}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="extractedAt" label="提取时间" width="180" />
|
|
||||||
<el-table-column label="提取平台" width="110">
|
<el-table-column label="提取平台" width="110">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row.extractedPlatform" :type="platformTagType(row.extractedPlatform)" size="small">
|
<el-tag
|
||||||
|
v-if="row.extractedPlatform"
|
||||||
|
:type="platformTagType(row.extractedPlatform)"
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
{{ platformText(row.extractedPlatform) }}
|
{{ platformText(row.extractedPlatform) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="账号类型" width="160" align="center">
|
||||||
|
<template #default="{ row }"
|
||||||
|
><el-tag>{{ typeText(row.type) }}</el-tag></template
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="account"
|
||||||
|
label="账号"
|
||||||
|
min-width="180"
|
||||||
|
show-overflow-tooltip
|
||||||
|
:tooltip-options="tooltipOpts"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="password"
|
||||||
|
label="密码"
|
||||||
|
min-width="160"
|
||||||
|
show-overflow-tooltip
|
||||||
|
:tooltip-options="tooltipOpts"
|
||||||
|
>
|
||||||
|
<template #default="{ row }">{{ row.password || "-" }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="Token"
|
||||||
|
min-width="200"
|
||||||
|
show-overflow-tooltip
|
||||||
|
:tooltip-options="tooltipOpts"
|
||||||
|
>
|
||||||
|
<template #default="{ row }">{{ row.token || "-" }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="remark"
|
||||||
|
label="备注"
|
||||||
|
min-width="140"
|
||||||
|
show-overflow-tooltip
|
||||||
|
:tooltip-options="tooltipOpts"
|
||||||
|
/>
|
||||||
|
<el-table-column prop="extractedAt" label="提取时间" width="180" />
|
||||||
<el-table-column label="操作" width="220" fixed="right" align="center">
|
<el-table-column label="操作" width="220" fixed="right" align="center">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button link type="primary" @click="openDetail(row)">详情</el-button>
|
<el-button link type="primary" @click="openDetail(row)"
|
||||||
<el-button link type="warning" :disabled="row.extracted" @click="openExtractByRow(row)">提取</el-button>
|
>详情</el-button
|
||||||
<el-button v-if="row.extracted" link type="success" @click="copyCardInfo(row)">复制</el-button>
|
>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="warning"
|
||||||
|
:disabled="row.extracted"
|
||||||
|
@click="openExtractByRow(row)"
|
||||||
|
>提取</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
v-if="row.extracted"
|
||||||
|
link
|
||||||
|
type="success"
|
||||||
|
@click="copyCardInfo(row)"
|
||||||
|
>复制</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -348,6 +532,7 @@ function copyCardInfo(row) {
|
|||||||
|
|
||||||
<Edit v-model="editVisible" :mode="editMode" @submit="handleEditSubmit" />
|
<Edit v-model="editVisible" :mode="editMode" @submit="handleEditSubmit" />
|
||||||
|
|
||||||
|
<<<<<<< Updated upstream
|
||||||
<DetailDialog
|
<DetailDialog
|
||||||
v-model="detailVisible"
|
v-model="detailVisible"
|
||||||
:row="detailRow"
|
:row="detailRow"
|
||||||
@ -366,11 +551,80 @@ function copyCardInfo(row) {
|
|||||||
@update:remark="(v) => (extractForm.remark = v)"
|
@update:remark="(v) => (extractForm.remark = v)"
|
||||||
@confirm="handleExtract"
|
@confirm="handleExtract"
|
||||||
/>
|
/>
|
||||||
|
=======
|
||||||
|
<el-dialog v-model="detailVisible" title="账号详情" width="560px">
|
||||||
|
<el-descriptions :column="1" border v-if="detailRow">
|
||||||
|
<el-descriptions-item label="ID">{{
|
||||||
|
detailRow.id
|
||||||
|
}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="账号类型">{{
|
||||||
|
typeText(detailRow.type)
|
||||||
|
}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="账号">{{
|
||||||
|
detailRow.account || "-"
|
||||||
|
}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="密码">{{
|
||||||
|
detailRow.password || "-"
|
||||||
|
}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="Token">
|
||||||
|
<span class="token-text">{{ detailRow.token || "-" }}</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="提取状态">{{
|
||||||
|
detailRow.extracted ? "已提取" : "未提取"
|
||||||
|
}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="提取时间">{{
|
||||||
|
detailRow.extractedAt || "-"
|
||||||
|
}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="提取平台">
|
||||||
|
<el-tag
|
||||||
|
v-if="detailRow.extractedPlatform"
|
||||||
|
:type="platformTagType(detailRow.extractedPlatform)"
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
{{ platformText(detailRow.extractedPlatform) }}
|
||||||
|
</el-tag>
|
||||||
|
<span v-else>-</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="备注">{{
|
||||||
|
detailRow.remark || "-"
|
||||||
|
}}</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog v-model="extractVisible" title="提取账号" width="420px">
|
||||||
|
<el-form label-width="84px">
|
||||||
|
<el-form-item label="提取类型">
|
||||||
|
<el-input :model-value="typeText(extractForm.type)" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="提取平台">
|
||||||
|
<el-select v-model="extractForm.platform" style="width: 100%">
|
||||||
|
<el-option
|
||||||
|
v-for="(v, k) in PLATFORM_MAP"
|
||||||
|
:key="k"
|
||||||
|
:value="k"
|
||||||
|
:label="v.label"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="extractVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" :loading="loading" @click="handleExtract"
|
||||||
|
>确认提取</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
>>>>>>> Stashed changes
|
||||||
|
|
||||||
<!-- 接口说明抽屉 -->
|
<!-- 接口说明抽屉 -->
|
||||||
<el-drawer v-model="apiDocVisible" title="提卡接口说明" size="560px" direction="rtl">
|
<el-drawer
|
||||||
|
v-model="apiDocVisible"
|
||||||
|
title="提卡接口说明"
|
||||||
|
size="560px"
|
||||||
|
direction="rtl"
|
||||||
|
>
|
||||||
<div class="api-doc">
|
<div class="api-doc">
|
||||||
<el-alert type="info" :closable="false" style="margin-bottom:16px">
|
<el-alert type="info" :closable="false" style="margin-bottom: 16px">
|
||||||
该接口为对外公开接口,无需登录认证,每次调用自动提取一条未使用的卡密并标记为已提取(不可重复)。
|
该接口为对外公开接口,无需登录认证,每次调用自动提取一条未使用的卡密并标记为已提取(不可重复)。
|
||||||
</el-alert>
|
</el-alert>
|
||||||
<div class="doc-section">
|
<div class="doc-section">
|
||||||
@ -382,9 +636,16 @@ function copyCardInfo(row) {
|
|||||||
<div class="doc-title">请求参数</div>
|
<div class="doc-title">请求参数</div>
|
||||||
<el-table :data="paramDocs" border size="small">
|
<el-table :data="paramDocs" border size="small">
|
||||||
<el-table-column prop="name" label="参数名" width="120" />
|
<el-table-column prop="name" label="参数名" width="120" />
|
||||||
<el-table-column prop="required" label="必填" width="60" align="center">
|
<el-table-column
|
||||||
|
prop="required"
|
||||||
|
label="必填"
|
||||||
|
width="60"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag :type="row.required ? 'danger' : 'info'" size="small">{{ row.required ? '是' : '否' }}</el-tag>
|
<el-tag :type="row.required ? 'danger' : 'info'" size="small">{{
|
||||||
|
row.required ? "是" : "否"
|
||||||
|
}}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="desc" label="说明" />
|
<el-table-column prop="desc" label="说明" />
|
||||||
@ -397,7 +658,13 @@ function copyCardInfo(row) {
|
|||||||
<div class="example-label">{{ ex.label }}</div>
|
<div class="example-label">{{ ex.label }}</div>
|
||||||
<div class="example-url-wrap">
|
<div class="example-url-wrap">
|
||||||
<code class="example-url">{{ ex.url }}</code>
|
<code class="example-url">{{ ex.url }}</code>
|
||||||
<el-button link type="primary" size="small" @click="copyText(ex.url)">复制</el-button>
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="copyText(ex.url)"
|
||||||
|
>复制</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -431,6 +698,7 @@ function copyCardInfo(row) {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
<<<<<<< Updated upstream
|
||||||
.account-pool-page { padding: 12px; }
|
.account-pool-page { padding: 12px; }
|
||||||
.card-header { display: flex; align-items: center; justify-content: space-between; }
|
.card-header { display: flex; align-items: center; justify-content: space-between; }
|
||||||
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
|
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
|
||||||
@ -449,6 +717,111 @@ function copyCardInfo(row) {
|
|||||||
.example-url-wrap { display: flex; align-items: center; gap: 8px; background: #f5f7fa; padding: 6px 10px; border-radius: 4px; }
|
.example-url-wrap { display: flex; align-items: center; gap: 8px; background: #f5f7fa; padding: 6px 10px; border-radius: 4px; }
|
||||||
.example-url { flex: 1; font-size: 12px; color: #409eff; word-break: break-all; }
|
.example-url { flex: 1; font-size: 12px; color: #409eff; word-break: break-all; }
|
||||||
.code-block { background: #1e1e1e; color: #d4d4d4; padding: 12px 16px; border-radius: 6px; font-size: 12px; line-height: 1.6; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 0; }
|
.code-block { background: #1e1e1e; color: #d4d4d4; padding: 12px 16px; border-radius: 6px; font-size: 12px; line-height: 1.6; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 0; }
|
||||||
|
=======
|
||||||
|
.account-pool-page {
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.toolbar {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
.toolbar-left,
|
||||||
|
.toolbar-right {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
.w-260 {
|
||||||
|
width: 260px;
|
||||||
|
}
|
||||||
|
.w-140 {
|
||||||
|
width: 140px;
|
||||||
|
}
|
||||||
|
.type-tabs {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
.pagination-wrap {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
margin-top: 14px;
|
||||||
|
}
|
||||||
|
.api-doc {
|
||||||
|
padding: 0 4px;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
.doc-section {
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
|
.doc-title {
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
color: #303133;
|
||||||
|
border-left: 3px solid #409eff;
|
||||||
|
padding-left: 8px;
|
||||||
|
}
|
||||||
|
.method-tag {
|
||||||
|
margin-right: 8px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.url-code {
|
||||||
|
background: #f5f7fa;
|
||||||
|
padding: 4px 10px;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #e6a23c;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
.example-item {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.example-label {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #909399;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
.example-url-wrap {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
background: #f5f7fa;
|
||||||
|
padding: 6px 10px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
.example-url {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #409eff;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
.code-block {
|
||||||
|
background: #1e1e1e;
|
||||||
|
color: #d4d4d4;
|
||||||
|
padding: 12px 16px;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.6;
|
||||||
|
overflow-x: auto;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-break: break-all;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.token-text {
|
||||||
|
word-break: break-all;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
>>>>>>> Stashed changes
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@ -1,32 +1,46 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
|
<<<<<<< Updated upstream
|
||||||
import { computed, onMounted, reactive, ref, watch } from 'vue';
|
import { computed, onMounted, reactive, ref, watch } from 'vue';
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import Edit from './components/edit.vue';
|
import Edit from './components/edit.vue';
|
||||||
import DetailDialog from './components/detail.vue';
|
import DetailDialog from './components/detail.vue';
|
||||||
import ExtractDialog from './components/extract.vue';
|
import ExtractDialog from './components/extract.vue';
|
||||||
|
=======
|
||||||
|
import { computed, onMounted, reactive, ref, watch } from "vue";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
import Edit from "./components/edit.vue";
|
||||||
|
>>>>>>> Stashed changes
|
||||||
import {
|
import {
|
||||||
addAccountPool,
|
addAccountPool,
|
||||||
batchAddAccountPool,
|
batchAddAccountPool,
|
||||||
extractAccountPool,
|
extractAccountPool,
|
||||||
getAccountPoolDetail,
|
getAccountPoolDetail,
|
||||||
getAccountPoolList,
|
getAccountPoolList,
|
||||||
|
<<<<<<< Updated upstream
|
||||||
updateAccountPoolRemark,
|
updateAccountPoolRemark,
|
||||||
} from '@/api/accountPool';
|
} from '@/api/accountPool';
|
||||||
|
=======
|
||||||
|
} from "@/api/accountPool";
|
||||||
|
>>>>>>> Stashed changes
|
||||||
|
|
||||||
const moduleKey = 'windsurf';
|
const moduleKey = "windsurf";
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const editVisible = ref(false);
|
const editVisible = ref(false);
|
||||||
const editMode = ref('single');
|
const editMode = ref("single");
|
||||||
const detailVisible = ref(false);
|
const detailVisible = ref(false);
|
||||||
const extractVisible = ref(false);
|
const extractVisible = ref(false);
|
||||||
const extractTargetRow = ref(null);
|
const extractTargetRow = ref(null);
|
||||||
const apiDocVisible = ref(false);
|
const apiDocVisible = ref(false);
|
||||||
|
|
||||||
const query = reactive({ keyword: '', status: '' });
|
const query = reactive({ keyword: "", status: "" });
|
||||||
const activeTypeTab = ref('all');
|
const activeTypeTab = ref("all");
|
||||||
|
|
||||||
|
<<<<<<< Updated upstream
|
||||||
const extractForm = reactive({ platform: 'local', type: 'account', remark: '' });
|
const extractForm = reactive({ platform: 'local', type: 'account', remark: '' });
|
||||||
|
=======
|
||||||
|
const extractForm = reactive({ platform: "local", type: "account" });
|
||||||
|
>>>>>>> Stashed changes
|
||||||
|
|
||||||
const tableData = ref([]);
|
const tableData = ref([]);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
@ -38,31 +52,42 @@ const pagination = reactive({ page: 1, pageSize: 30 });
|
|||||||
const pagedList = computed(() => tableData.value);
|
const pagedList = computed(() => tableData.value);
|
||||||
|
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
query.keyword = '';
|
query.keyword = "";
|
||||||
query.status = '';
|
query.status = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
const typeTabs = computed(() => [
|
const typeTabs = computed(() => [
|
||||||
{ label: '全部', value: 'all' },
|
{ label: "全部", value: "all" },
|
||||||
{ label: '账号密码', value: 'account' },
|
{ label: "账号密码", value: "account" },
|
||||||
{ label: '账号密码+Token', value: 'account_tk' },
|
{ label: "账号密码+Token", value: "account_tk" },
|
||||||
{ label: 'Token', value: 'tk' },
|
{ label: "Token", value: "tk" },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
watch(() => [query.keyword, query.status, activeTypeTab.value], () => {
|
watch(
|
||||||
|
() => [query.keyword, query.status, activeTypeTab.value],
|
||||||
|
() => {
|
||||||
pagination.page = 1;
|
pagination.page = 1;
|
||||||
fetchList();
|
fetchList();
|
||||||
});
|
},
|
||||||
watch(() => [pagination.page, pagination.pageSize], () => { fetchList(); });
|
);
|
||||||
|
watch(
|
||||||
|
() => [pagination.page, pagination.pageSize],
|
||||||
|
() => {
|
||||||
|
fetchList();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
function openAddDialog(mode = 'single') {
|
function openAddDialog(mode = "single") {
|
||||||
editMode.value = mode;
|
editMode.value = mode;
|
||||||
editVisible.value = true;
|
editVisible.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function saveRows(rows) {
|
async function saveRows(rows) {
|
||||||
if (!rows.length) return;
|
if (!rows.length) return;
|
||||||
if (rows.length === 1) { await addAccountPool(moduleKey, rows[0]); return; }
|
if (rows.length === 1) {
|
||||||
|
await addAccountPool(moduleKey, rows[0]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
await batchAddAccountPool(moduleKey, rows);
|
await batchAddAccountPool(moduleKey, rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,27 +95,38 @@ async function handleEditSubmit(payload) {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
await saveRows(payload.rows || []);
|
await saveRows(payload.rows || []);
|
||||||
ElMessage.success(payload.mode === 'batch' ? '批量添加成功' : '账号添加成功');
|
ElMessage.success(
|
||||||
|
payload.mode === "batch" ? "批量添加成功" : "账号添加成功",
|
||||||
|
);
|
||||||
await fetchList();
|
await fetchList();
|
||||||
} finally { loading.value = false; }
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSelectionChange(rows) { selectedRows.value = rows; }
|
function handleSelectionChange(rows) {
|
||||||
|
selectedRows.value = rows;
|
||||||
|
}
|
||||||
|
|
||||||
function openDetail(row) {
|
function openDetail(row) {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
getAccountPoolDetail(moduleKey, row.id)
|
getAccountPoolDetail(moduleKey, row.id)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res?.code !== 200) { ElMessage.error(res?.msg || '获取详情失败'); return; }
|
if (res?.code !== 200) {
|
||||||
|
ElMessage.error(res?.msg || "获取详情失败");
|
||||||
|
return;
|
||||||
|
}
|
||||||
detailRow.value = normalizeRow(res.data || {});
|
detailRow.value = normalizeRow(res.data || {});
|
||||||
detailVisible.value = true;
|
detailVisible.value = true;
|
||||||
})
|
})
|
||||||
.finally(() => { loading.value = false; });
|
.finally(() => {
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function openExtractByRow(row) {
|
function openExtractByRow(row) {
|
||||||
extractTargetRow.value = row;
|
extractTargetRow.value = row;
|
||||||
extractForm.platform = 'local';
|
extractForm.platform = "local";
|
||||||
extractForm.type = row.type;
|
extractForm.type = row.type;
|
||||||
extractForm.remark = row.remark || '';
|
extractForm.remark = row.remark || '';
|
||||||
extractVisible.value = true;
|
extractVisible.value = true;
|
||||||
@ -100,15 +136,29 @@ async function handleExtract() {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
const target = extractTargetRow.value;
|
const target = extractTargetRow.value;
|
||||||
if (!target) { ElMessage.warning('未找到提取目标'); return; }
|
if (!target) {
|
||||||
|
ElMessage.warning("未找到提取目标");
|
||||||
|
return;
|
||||||
|
}
|
||||||
const res = await extractAccountPool(moduleKey, {
|
const res = await extractAccountPool(moduleKey, {
|
||||||
|
<<<<<<< Updated upstream
|
||||||
id: target.id, type: target.type, platform: extractForm.platform, remark: extractForm.remark || '',
|
id: target.id, type: target.type, platform: extractForm.platform, remark: extractForm.remark || '',
|
||||||
|
=======
|
||||||
|
id: target.id,
|
||||||
|
type: target.type,
|
||||||
|
platform: extractForm.platform,
|
||||||
|
>>>>>>> Stashed changes
|
||||||
});
|
});
|
||||||
if (res?.code !== 200) { ElMessage.error(res?.msg || '提取失败'); return; }
|
if (res?.code !== 200) {
|
||||||
ElMessage.success('提取成功');
|
ElMessage.error(res?.msg || "提取失败");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ElMessage.success("提取成功");
|
||||||
extractVisible.value = false;
|
extractVisible.value = false;
|
||||||
await fetchList();
|
await fetchList();
|
||||||
} finally { loading.value = false; }
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleSaveRemark(payload) {
|
async function handleSaveRemark(payload) {
|
||||||
@ -126,44 +176,65 @@ async function handleSaveRemark(payload) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function markExtractForSelected() {
|
function markExtractForSelected() {
|
||||||
if (!selectedRows.value.length) { ElMessage.warning('请先选择数据'); return; }
|
if (!selectedRows.value.length) {
|
||||||
|
ElMessage.warning("请先选择数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
Promise.all(
|
Promise.all(
|
||||||
selectedRows.value.map((row) =>
|
selectedRows.value.map((row) =>
|
||||||
extractAccountPool(moduleKey, { id: row.id, type: row.type, platform: 'local' })
|
extractAccountPool(moduleKey, {
|
||||||
|
id: row.id,
|
||||||
|
type: row.type,
|
||||||
|
platform: "local",
|
||||||
|
}),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
).then(() => { ElMessage.success('批量提取成功'); fetchList(); })
|
.then(() => {
|
||||||
.finally(() => { loading.value = false; });
|
ElMessage.success("批量提取成功");
|
||||||
|
fetchList();
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function typeText(type) {
|
function typeText(type) {
|
||||||
if (type === 'account') return '账号密码';
|
if (type === "account") return "账号密码";
|
||||||
if (type === 'account_tk') return '账号密码+Token';
|
if (type === "account_tk") return "账号密码+Token";
|
||||||
return 'Token';
|
return "Token";
|
||||||
}
|
}
|
||||||
|
|
||||||
const tooltipOpts = {
|
const tooltipOpts = {
|
||||||
popperClass: 'pool-tooltip',
|
popperClass: "pool-tooltip",
|
||||||
popperStyle: { maxWidth: '600px', wordBreak: 'break-all', whiteSpace: 'pre-wrap' },
|
popperStyle: {
|
||||||
|
maxWidth: "600px",
|
||||||
|
wordBreak: "break-all",
|
||||||
|
whiteSpace: "pre-wrap",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const PLATFORM_MAP = {
|
const PLATFORM_MAP = {
|
||||||
local: { label: '本地', type: 'info' },
|
local: { label: "本地", type: "info" },
|
||||||
xianyu: { label: '闲鱼', type: 'warning' },
|
xianyu: { label: "闲鱼", type: "warning" },
|
||||||
pinduoduo: { label: '拼多多', type: 'danger' },
|
pinduoduo: { label: "拼多多", type: "danger" },
|
||||||
jingdong: { label: '京东', type: 'primary' },
|
jingdong: { label: "京东", type: "primary" },
|
||||||
douyin: { label: '抖音', type: 'success' },
|
douyin: { label: "抖音", type: "success" },
|
||||||
};
|
};
|
||||||
|
|
||||||
function platformText(platform) { return PLATFORM_MAP[platform]?.label || (platform || '-'); }
|
function platformText(platform) {
|
||||||
function platformTagType(platform) { return PLATFORM_MAP[platform]?.type || 'info'; }
|
return PLATFORM_MAP[platform]?.label || platform || "-";
|
||||||
|
}
|
||||||
|
function platformTagType(platform) {
|
||||||
|
return PLATFORM_MAP[platform]?.type || "info";
|
||||||
|
}
|
||||||
|
|
||||||
function normalizeRow(raw) {
|
function normalizeRow(raw) {
|
||||||
const pick = (...keys) => {
|
const pick = (...keys) => {
|
||||||
for (const key of keys) {
|
for (const key of keys) {
|
||||||
if (raw?.[key] !== undefined && raw?.[key] !== null) return raw[key];
|
if (raw?.[key] !== undefined && raw?.[key] !== null) return raw[key];
|
||||||
}
|
}
|
||||||
return '';
|
return "";
|
||||||
};
|
};
|
||||||
const pickNullable = (...keys) => {
|
const pickNullable = (...keys) => {
|
||||||
for (const key of keys) {
|
for (const key of keys) {
|
||||||
@ -172,23 +243,23 @@ function normalizeRow(raw) {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
const formatTime = (val) => {
|
const formatTime = (val) => {
|
||||||
if (!val) return '';
|
if (!val) return "";
|
||||||
const d = new Date(val);
|
const d = new Date(val);
|
||||||
if (isNaN(d)) return val;
|
if (isNaN(d)) return val;
|
||||||
const p = (v) => String(v).padStart(2, '0');
|
const p = (v) => String(v).padStart(2, "0");
|
||||||
return `${d.getFullYear()}-${p(d.getMonth()+1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}`;
|
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}`;
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
id: pick('id', 'Id', 'ID'),
|
id: pick("id", "Id", "ID"),
|
||||||
type: pick('data_type', 'dataType', 'type'),
|
type: pick("data_type", "dataType", "type"),
|
||||||
account: pick('account', 'Account'),
|
account: pick("account", "Account"),
|
||||||
password: pick('password', 'Password'),
|
password: pick("password", "Password"),
|
||||||
token: pick('token', 'Token'),
|
token: pick("token", "Token"),
|
||||||
remark: pick('remark', 'Remark'),
|
remark: pick("remark", "Remark"),
|
||||||
extracted: Number(pick('is_extracted', 'isExtracted', 'IsExtracted')) === 1,
|
extracted: Number(pick("is_extracted", "isExtracted", "IsExtracted")) === 1,
|
||||||
extractedAt: formatTime(pickNullable('extracted_time', 'extractedAt')),
|
extractedAt: formatTime(pickNullable("extracted_time", "extractedAt")),
|
||||||
extractedPlatform: pickNullable('extracted_platform', 'extractedPlatform'),
|
extractedPlatform: pickNullable("extracted_platform", "extractedPlatform"),
|
||||||
createdAt: formatTime(pick('create_time', 'createdAt')),
|
createdAt: formatTime(pick("create_time", "createdAt")),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,48 +267,83 @@ async function fetchList() {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
const res = await getAccountPoolList(moduleKey, {
|
const res = await getAccountPoolList(moduleKey, {
|
||||||
page: pagination.page, pageSize: pagination.pageSize,
|
page: pagination.page,
|
||||||
|
pageSize: pagination.pageSize,
|
||||||
keyword: query.keyword || undefined,
|
keyword: query.keyword || undefined,
|
||||||
status: query.status || undefined,
|
status: query.status || undefined,
|
||||||
type: activeTypeTab.value === 'all' ? undefined : activeTypeTab.value,
|
type: activeTypeTab.value === "all" ? undefined : activeTypeTab.value,
|
||||||
});
|
});
|
||||||
if (res?.code !== 200) { ElMessage.error(res?.msg || '获取列表失败'); return; }
|
if (res?.code !== 200) {
|
||||||
|
ElMessage.error(res?.msg || "获取列表失败");
|
||||||
|
return;
|
||||||
|
}
|
||||||
const list = Array.isArray(res?.data?.list) ? res.data.list : [];
|
const list = Array.isArray(res?.data?.list) ? res.data.list : [];
|
||||||
tableData.value = list.map(normalizeRow);
|
tableData.value = list.map(normalizeRow);
|
||||||
total.value = Number(res?.data?.total || 0);
|
total.value = Number(res?.data?.total || 0);
|
||||||
} finally { loading.value = false; }
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => { fetchList(); });
|
onMounted(() => {
|
||||||
|
fetchList();
|
||||||
|
});
|
||||||
|
|
||||||
// ---- 接口说明数据 ----
|
// ---- 接口说明数据 ----
|
||||||
const BASE_URL = 'https://api.yunzer.cn';
|
const BASE_URL = "https://api.yunzer.cn";
|
||||||
|
|
||||||
const paramDocs = [
|
const paramDocs = [
|
||||||
{ name: 'type', required: true, desc: '来源平台,用于标记本次提取来自哪个渠道', values: 'xianyu / pinduoduo / jingdong / douyin / local' },
|
{
|
||||||
{ name: 'module', required: true, desc: '号池模块,指定从哪个产品的号池提取', values: 'cursor / windsurf / krio' },
|
name: "type",
|
||||||
{ name: 'data_type', required: false, desc: '账号类型,不传则提取任意类型', values: 'account / tk / account_tk' },
|
required: true,
|
||||||
|
desc: "来源平台,用于标记本次提取来自哪个渠道",
|
||||||
|
values: "xianyu / pinduoduo / jingdong / douyin / local",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "module",
|
||||||
|
required: true,
|
||||||
|
desc: "号池模块,指定从哪个产品的号池提取",
|
||||||
|
values: "cursor / windsurf / krio",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "data_type",
|
||||||
|
required: false,
|
||||||
|
desc: "账号类型,不传则提取任意类型",
|
||||||
|
values: "account / tk / account_tk",
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const platformDocs = [
|
const platformDocs = [
|
||||||
{ value: 'xianyu', label: '闲鱼', desc: '闲鱼平台发货调用' },
|
{ value: "xianyu", label: "闲鱼", desc: "闲鱼平台发货调用" },
|
||||||
{ value: 'pinduoduo', label: '拼多多', desc: '拼多多平台发货调用' },
|
{ value: "pinduoduo", label: "拼多多", desc: "拼多多平台发货调用" },
|
||||||
{ value: 'jingdong', label: '京东', desc: '京东平台发货调用' },
|
{ value: "jingdong", label: "京东", desc: "京东平台发货调用" },
|
||||||
{ value: 'douyin', label: '抖音', desc: '抖音平台发货调用' },
|
{ value: "douyin", label: "抖音", desc: "抖音平台发货调用" },
|
||||||
{ value: 'local', label: '本地', desc: '本地手动调用' },
|
{ value: "local", label: "本地", desc: "本地手动调用" },
|
||||||
];
|
];
|
||||||
|
|
||||||
const moduleDocs = [
|
const moduleDocs = [
|
||||||
{ value: 'cursor', label: 'Cursor', desc: 'Cursor 号池' },
|
{ value: "cursor", label: "Cursor", desc: "Cursor 号池" },
|
||||||
{ value: 'windsurf', label: 'Windsurf', desc: 'Windsurf 号池' },
|
{ value: "windsurf", label: "Windsurf", desc: "Windsurf 号池" },
|
||||||
{ value: 'krio', label: 'Krio', desc: 'Krio 号池' },
|
{ value: "krio", label: "Krio", desc: "Krio 号池" },
|
||||||
];
|
];
|
||||||
|
|
||||||
const examples = [
|
const examples = [
|
||||||
{ label: '闲鱼 · 提取 Windsurf Token', url: `${BASE_URL}/api/getcard?type=xianyu&module=windsurf&data_type=tk` },
|
{
|
||||||
{ label: '拼多多 · 提取 Windsurf 账号密码', url: `${BASE_URL}/api/getcard?type=pinduoduo&module=windsurf&data_type=account` },
|
label: "闲鱼 · 提取 Windsurf Token",
|
||||||
{ label: '京东 · 提取 Cursor 任意类型', url: `${BASE_URL}/api/getcard?type=jingdong&module=cursor` },
|
url: `${BASE_URL}/api/getcard?type=xianyu&module=windsurf&data_type=tk`,
|
||||||
{ label: '抖音 · 提取 Krio Token', url: `${BASE_URL}/api/getcard?type=douyin&module=krio&data_type=tk` },
|
},
|
||||||
|
{
|
||||||
|
label: "拼多多 · 提取 Windsurf 账号密码",
|
||||||
|
url: `${BASE_URL}/api/getcard?type=pinduoduo&module=windsurf&data_type=account`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "京东 · 提取 Cursor 任意类型",
|
||||||
|
url: `${BASE_URL}/api/getcard?type=jingdong&module=cursor`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "抖音 · 提取 Krio Token",
|
||||||
|
url: `${BASE_URL}/api/getcard?type=douyin&module=krio&data_type=tk`,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const successResp = `// 纯 Token 类型(data_type=tk)
|
const successResp = `// 纯 Token 类型(data_type=tk)
|
||||||
@ -256,7 +362,9 @@ const errorResp = `// 无可用卡密
|
|||||||
{ "code": 400, "msg": "缺少参数 type(来源平台)" }`;
|
{ "code": 400, "msg": "缺少参数 type(来源平台)" }`;
|
||||||
|
|
||||||
function copyText(text) {
|
function copyText(text) {
|
||||||
navigator.clipboard.writeText(text).then(() => { ElMessage.success('已复制'); });
|
navigator.clipboard.writeText(text).then(() => {
|
||||||
|
ElMessage.success("已复制");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyCardInfo(row) {
|
function copyCardInfo(row) {
|
||||||
@ -264,8 +372,13 @@ function copyCardInfo(row) {
|
|||||||
if (row.account) parts.push(row.account);
|
if (row.account) parts.push(row.account);
|
||||||
if (row.password) parts.push(row.password);
|
if (row.password) parts.push(row.password);
|
||||||
if (row.token) parts.push(row.token);
|
if (row.token) parts.push(row.token);
|
||||||
if (!parts.length) { ElMessage.warning('无可复制内容'); return; }
|
if (!parts.length) {
|
||||||
navigator.clipboard.writeText(parts.join('\n')).then(() => { ElMessage.success('已复制'); });
|
ElMessage.warning("无可复制内容");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
navigator.clipboard.writeText(parts.join("\n")).then(() => {
|
||||||
|
ElMessage.success("已复制");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -278,58 +391,129 @@ function copyCardInfo(row) {
|
|||||||
|
|
||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<div class="toolbar-left">
|
<div class="toolbar-left">
|
||||||
<el-input v-model="query.keyword" placeholder="搜索账号 / token / 备注" clearable class="w-260" />
|
<el-input
|
||||||
<el-select v-model="query.status" placeholder="提取状态" clearable class="w-140">
|
v-model="query.keyword"
|
||||||
|
placeholder="搜索账号 / token / 备注"
|
||||||
|
clearable
|
||||||
|
class="w-260"
|
||||||
|
/>
|
||||||
|
<el-select
|
||||||
|
v-model="query.status"
|
||||||
|
placeholder="提取状态"
|
||||||
|
clearable
|
||||||
|
class="w-140"
|
||||||
|
>
|
||||||
<el-option label="未提取" value="unused" />
|
<el-option label="未提取" value="unused" />
|
||||||
<el-option label="已提取" value="extracted" />
|
<el-option label="已提取" value="extracted" />
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-button @click="resetQuery">重置</el-button>
|
<el-button @click="resetQuery">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="toolbar-right">
|
<div class="toolbar-right">
|
||||||
<el-button type="primary" @click="openAddDialog('single')">添加账号</el-button>
|
<el-button type="primary" @click="openAddDialog('single')"
|
||||||
<el-button type="success" @click="openAddDialog('batch')">批量添加</el-button>
|
>添加账号</el-button
|
||||||
|
>
|
||||||
|
<el-button type="success" @click="openAddDialog('batch')"
|
||||||
|
>批量添加</el-button
|
||||||
|
>
|
||||||
<el-button @click="markExtractForSelected">批量标记提取</el-button>
|
<el-button @click="markExtractForSelected">批量标记提取</el-button>
|
||||||
<el-button @click="apiDocVisible = true">接口说明</el-button>
|
<el-button @click="apiDocVisible = true">接口说明</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-tabs v-model="activeTypeTab" class="type-tabs">
|
<el-tabs v-model="activeTypeTab" class="type-tabs">
|
||||||
<el-tab-pane v-for="tab in typeTabs" :key="tab.value" :label="tab.label" :name="tab.value" />
|
<el-tab-pane
|
||||||
|
v-for="tab in typeTabs"
|
||||||
|
:key="tab.value"
|
||||||
|
:label="tab.label"
|
||||||
|
:name="tab.value"
|
||||||
|
/>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
|
||||||
<el-table :data="pagedList" border stripe style="width: 100%" :loading="loading" @selection-change="handleSelectionChange">
|
<el-table
|
||||||
|
:data="pagedList"
|
||||||
|
border
|
||||||
|
stripe
|
||||||
|
style="width: 100%"
|
||||||
|
:loading="loading"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
<el-table-column type="selection" width="52" />
|
<el-table-column type="selection" width="52" />
|
||||||
<el-table-column prop="id" label="ID" width="80" />
|
<el-table-column prop="id" label="ID" width="80" />
|
||||||
<el-table-column label="账号类型" width="160" align="center">
|
|
||||||
<template #default="{ row }"><el-tag>{{ typeText(row.type) }}</el-tag></template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="account" label="账号" min-width="180" show-overflow-tooltip :tooltip-options="tooltipOpts" />
|
|
||||||
<el-table-column prop="password" label="密码" min-width="160" show-overflow-tooltip :tooltip-options="tooltipOpts">
|
|
||||||
<template #default="{ row }">{{ row.password || '-' }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="Token" min-width="200" show-overflow-tooltip :tooltip-options="tooltipOpts">
|
|
||||||
<template #default="{ row }">{{ row.token || '-' }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="remark" label="备注" min-width="140" show-overflow-tooltip :tooltip-options="tooltipOpts" />
|
|
||||||
<el-table-column label="提取状态" width="100">
|
<el-table-column label="提取状态" width="100">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag :type="row.extracted ? 'success' : 'info'">{{ row.extracted ? '已提取' : '未提取' }}</el-tag>
|
<el-tag :type="row.extracted ? 'success' : 'info'">{{
|
||||||
|
row.extracted ? "已提取" : "未提取"
|
||||||
|
}}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="extractedAt" label="提取时间" width="180" />
|
|
||||||
<el-table-column label="提取平台" width="110">
|
<el-table-column label="提取平台" width="110">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row.extractedPlatform" :type="platformTagType(row.extractedPlatform)" size="small">
|
<el-tag
|
||||||
|
v-if="row.extractedPlatform"
|
||||||
|
:type="platformTagType(row.extractedPlatform)"
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
{{ platformText(row.extractedPlatform) }}
|
{{ platformText(row.extractedPlatform) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="账号类型" width="160" align="center">
|
||||||
|
<template #default="{ row }"
|
||||||
|
><el-tag>{{ typeText(row.type) }}</el-tag></template
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="account"
|
||||||
|
label="账号"
|
||||||
|
min-width="180"
|
||||||
|
show-overflow-tooltip
|
||||||
|
:tooltip-options="tooltipOpts"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="password"
|
||||||
|
label="密码"
|
||||||
|
min-width="160"
|
||||||
|
show-overflow-tooltip
|
||||||
|
:tooltip-options="tooltipOpts"
|
||||||
|
>
|
||||||
|
<template #default="{ row }">{{ row.password || "-" }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="Token"
|
||||||
|
min-width="200"
|
||||||
|
show-overflow-tooltip
|
||||||
|
:tooltip-options="tooltipOpts"
|
||||||
|
>
|
||||||
|
<template #default="{ row }">{{ row.token || "-" }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="remark"
|
||||||
|
label="备注"
|
||||||
|
min-width="140"
|
||||||
|
show-overflow-tooltip
|
||||||
|
:tooltip-options="tooltipOpts"
|
||||||
|
/>
|
||||||
|
<el-table-column prop="extractedAt" label="提取时间" width="180" />
|
||||||
<el-table-column label="操作" width="220" fixed="right" align="center">
|
<el-table-column label="操作" width="220" fixed="right" align="center">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button link type="primary" @click="openDetail(row)">详情</el-button>
|
<el-button link type="primary" @click="openDetail(row)"
|
||||||
<el-button link type="warning" :disabled="row.extracted" @click="openExtractByRow(row)">提取</el-button>
|
>详情</el-button
|
||||||
<el-button v-if="row.extracted" link type="success" @click="copyCardInfo(row)">复制</el-button>
|
>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="warning"
|
||||||
|
:disabled="row.extracted"
|
||||||
|
@click="openExtractByRow(row)"
|
||||||
|
>提取</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
v-if="row.extracted"
|
||||||
|
link
|
||||||
|
type="success"
|
||||||
|
@click="copyCardInfo(row)"
|
||||||
|
>复制</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -348,6 +532,7 @@ function copyCardInfo(row) {
|
|||||||
|
|
||||||
<Edit v-model="editVisible" :mode="editMode" @submit="handleEditSubmit" />
|
<Edit v-model="editVisible" :mode="editMode" @submit="handleEditSubmit" />
|
||||||
|
|
||||||
|
<<<<<<< Updated upstream
|
||||||
<DetailDialog
|
<DetailDialog
|
||||||
v-model="detailVisible"
|
v-model="detailVisible"
|
||||||
:row="detailRow"
|
:row="detailRow"
|
||||||
@ -366,11 +551,80 @@ function copyCardInfo(row) {
|
|||||||
@update:remark="(v) => (extractForm.remark = v)"
|
@update:remark="(v) => (extractForm.remark = v)"
|
||||||
@confirm="handleExtract"
|
@confirm="handleExtract"
|
||||||
/>
|
/>
|
||||||
|
=======
|
||||||
|
<el-dialog v-model="detailVisible" title="账号详情" width="560px">
|
||||||
|
<el-descriptions :column="1" border v-if="detailRow">
|
||||||
|
<el-descriptions-item label="ID">{{
|
||||||
|
detailRow.id
|
||||||
|
}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="提取状态">{{
|
||||||
|
detailRow.extracted ? "已提取" : "未提取"
|
||||||
|
}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="提取平台">
|
||||||
|
<el-tag
|
||||||
|
v-if="detailRow.extractedPlatform"
|
||||||
|
:type="platformTagType(detailRow.extractedPlatform)"
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
{{ platformText(detailRow.extractedPlatform) }}
|
||||||
|
</el-tag>
|
||||||
|
<span v-else>-</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="账号类型">{{
|
||||||
|
typeText(detailRow.type)
|
||||||
|
}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="账号">{{
|
||||||
|
detailRow.account || "-"
|
||||||
|
}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="密码">{{
|
||||||
|
detailRow.password || "-"
|
||||||
|
}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="Token">
|
||||||
|
<span class="token-text">{{ detailRow.token || "-" }}</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="提取时间">{{
|
||||||
|
detailRow.extractedAt || "-"
|
||||||
|
}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="备注">{{
|
||||||
|
detailRow.remark || "-"
|
||||||
|
}}</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog v-model="extractVisible" title="提取账号" width="420px">
|
||||||
|
<el-form label-width="84px">
|
||||||
|
<el-form-item label="提取类型">
|
||||||
|
<el-input :model-value="typeText(extractForm.type)" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="提取平台">
|
||||||
|
<el-select v-model="extractForm.platform" style="width: 100%">
|
||||||
|
<el-option
|
||||||
|
v-for="(v, k) in PLATFORM_MAP"
|
||||||
|
:key="k"
|
||||||
|
:value="k"
|
||||||
|
:label="v.label"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="extractVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" :loading="loading" @click="handleExtract"
|
||||||
|
>确认提取</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
>>>>>>> Stashed changes
|
||||||
|
|
||||||
<!-- 接口说明抽屉 -->
|
<!-- 接口说明抽屉 -->
|
||||||
<el-drawer v-model="apiDocVisible" title="提卡接口说明" size="560px" direction="rtl">
|
<el-drawer
|
||||||
|
v-model="apiDocVisible"
|
||||||
|
title="提卡接口说明"
|
||||||
|
size="560px"
|
||||||
|
direction="rtl"
|
||||||
|
>
|
||||||
<div class="api-doc">
|
<div class="api-doc">
|
||||||
<el-alert type="info" :closable="false" style="margin-bottom:16px">
|
<el-alert type="info" :closable="false" style="margin-bottom: 16px">
|
||||||
该接口为对外公开接口,无需登录认证,每次调用自动提取一条未使用的卡密并标记为已提取(不可重复)。
|
该接口为对外公开接口,无需登录认证,每次调用自动提取一条未使用的卡密并标记为已提取(不可重复)。
|
||||||
</el-alert>
|
</el-alert>
|
||||||
<div class="doc-section">
|
<div class="doc-section">
|
||||||
@ -382,9 +636,16 @@ function copyCardInfo(row) {
|
|||||||
<div class="doc-title">请求参数</div>
|
<div class="doc-title">请求参数</div>
|
||||||
<el-table :data="paramDocs" border size="small">
|
<el-table :data="paramDocs" border size="small">
|
||||||
<el-table-column prop="name" label="参数名" width="120" />
|
<el-table-column prop="name" label="参数名" width="120" />
|
||||||
<el-table-column prop="required" label="必填" width="60" align="center">
|
<el-table-column
|
||||||
|
prop="required"
|
||||||
|
label="必填"
|
||||||
|
width="60"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag :type="row.required ? 'danger' : 'info'" size="small">{{ row.required ? '是' : '否' }}</el-tag>
|
<el-tag :type="row.required ? 'danger' : 'info'" size="small">{{
|
||||||
|
row.required ? "是" : "否"
|
||||||
|
}}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="desc" label="说明" />
|
<el-table-column prop="desc" label="说明" />
|
||||||
@ -397,7 +658,13 @@ function copyCardInfo(row) {
|
|||||||
<div class="example-label">{{ ex.label }}</div>
|
<div class="example-label">{{ ex.label }}</div>
|
||||||
<div class="example-url-wrap">
|
<div class="example-url-wrap">
|
||||||
<code class="example-url">{{ ex.url }}</code>
|
<code class="example-url">{{ ex.url }}</code>
|
||||||
<el-button link type="primary" size="small" @click="copyText(ex.url)">复制</el-button>
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="copyText(ex.url)"
|
||||||
|
>复制</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -431,6 +698,7 @@ function copyCardInfo(row) {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
<<<<<<< Updated upstream
|
||||||
.account-pool-page { padding: 12px; }
|
.account-pool-page { padding: 12px; }
|
||||||
.card-header { display: flex; align-items: center; justify-content: space-between; }
|
.card-header { display: flex; align-items: center; justify-content: space-between; }
|
||||||
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
|
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
|
||||||
@ -449,6 +717,111 @@ function copyCardInfo(row) {
|
|||||||
.example-url-wrap { display: flex; align-items: center; gap: 8px; background: #f5f7fa; padding: 6px 10px; border-radius: 4px; }
|
.example-url-wrap { display: flex; align-items: center; gap: 8px; background: #f5f7fa; padding: 6px 10px; border-radius: 4px; }
|
||||||
.example-url { flex: 1; font-size: 12px; color: #409eff; word-break: break-all; }
|
.example-url { flex: 1; font-size: 12px; color: #409eff; word-break: break-all; }
|
||||||
.code-block { background: #1e1e1e; color: #d4d4d4; padding: 12px 16px; border-radius: 6px; font-size: 12px; line-height: 1.6; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 0; }
|
.code-block { background: #1e1e1e; color: #d4d4d4; padding: 12px 16px; border-radius: 6px; font-size: 12px; line-height: 1.6; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 0; }
|
||||||
|
=======
|
||||||
|
.account-pool-page {
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
.card-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.toolbar {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
.toolbar-left,
|
||||||
|
.toolbar-right {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
.w-260 {
|
||||||
|
width: 260px;
|
||||||
|
}
|
||||||
|
.w-140 {
|
||||||
|
width: 140px;
|
||||||
|
}
|
||||||
|
.type-tabs {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
.pagination-wrap {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
margin-top: 14px;
|
||||||
|
}
|
||||||
|
.api-doc {
|
||||||
|
padding: 0 4px;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
.doc-section {
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
|
.doc-title {
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
color: #303133;
|
||||||
|
border-left: 3px solid #409eff;
|
||||||
|
padding-left: 8px;
|
||||||
|
}
|
||||||
|
.method-tag {
|
||||||
|
margin-right: 8px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.url-code {
|
||||||
|
background: #f5f7fa;
|
||||||
|
padding: 4px 10px;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #e6a23c;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
.example-item {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.example-label {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #909399;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
.example-url-wrap {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
background: #f5f7fa;
|
||||||
|
padding: 6px 10px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
.example-url {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #409eff;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
.code-block {
|
||||||
|
background: #1e1e1e;
|
||||||
|
color: #d4d4d4;
|
||||||
|
padding: 12px 16px;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.6;
|
||||||
|
overflow-x: auto;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-break: break-all;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.token-text {
|
||||||
|
word-break: break-all;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
>>>>>>> Stashed changes
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
1
新建 文本文档.txt
Normal file
1
新建 文本文档.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
https://sendcard.yunzer.cn/api/getcard?type=xianyu
|
||||||
Loading…
Reference in New Issue
Block a user