From e05ac23cc31049dc18615bf601dbf9d51b6cf285 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=89=AB=E5=9C=B0=E5=83=A7?= <357099073@qq.com>
Date: Tue, 5 May 2026 23:55:17 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0token=E6=A3=80=E6=B5=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/accountPool.js | 9 +
.../accountpool/cursor/components/detail.vue | 11 ++
src/views/accountpool/cursor/index.vue | 172 +++++++++++++++++-
src/views/accountpool/kiro/index.vue | 37 +++-
src/views/accountpool/windsurf/index.vue | 37 +++-
5 files changed, 260 insertions(+), 6 deletions(-)
diff --git a/src/api/accountPool.js b/src/api/accountPool.js
index 3e3ff82..2206e2e 100644
--- a/src/api/accountPool.js
+++ b/src/api/accountPool.js
@@ -58,3 +58,12 @@ export function replenishAccountPool(module, data) {
data,
});
}
+
+/** 使用厂商 Token 探测是否可用(服务端转发)。Cursor 传 { id, accessToken }(会话 JWT)以便回写 is_used;仅传 accessToken 也可探测但不更新库;Windsurf/Kiro 传 { id } */
+export function probeAccountPoolToken(module, data) {
+ return request({
+ url: `${base(module)}/probeToken`,
+ method: 'post',
+ data,
+ });
+}
diff --git a/src/views/accountpool/cursor/components/detail.vue b/src/views/accountpool/cursor/components/detail.vue
index f99d4b5..c0db780 100644
--- a/src/views/accountpool/cursor/components/detail.vue
+++ b/src/views/accountpool/cursor/components/detail.vue
@@ -104,6 +104,17 @@ function copyToken() {
row.extractStatus === 2 ? '补号' : row.extracted ? '已提取' : '未提取'
}}
+
+ {{
+ row.isUsed === null || row.isUsed === undefined
+ ? '未探测'
+ : Number(row.isUsed) === 1
+ ? '可用'
+ : Number(row.isUsed) === 0
+ ? '已用完'
+ : String(row.isUsed)
+ }}
+
{{ row.extractedAt || '-' }}
diff --git a/src/views/accountpool/cursor/index.vue b/src/views/accountpool/cursor/index.vue
index 86c8748..ed0d9ed 100644
--- a/src/views/accountpool/cursor/index.vue
+++ b/src/views/accountpool/cursor/index.vue
@@ -1,6 +1,6 @@
@@ -553,6 +679,15 @@ function copyCardInfo(row) {
+
+
+
+
批量添加
补号
批量标记提取
+ 批量检测
接口说明
@@ -613,6 +749,13 @@ function copyCardInfo(row) {
+
+
+
+ {{ isUsedLabel(row.isUsed) }}
+
+
+
@@ -626,8 +769,16 @@ function copyCardInfo(row) {
-
-
+
+ 检测
详情
@@ -999,4 +1150,17 @@ function copyCardInfo(row) {
.pool-tooltip .el-popper__arrow {
display: block;
}
+
+/* Cursor 探测结果弹窗(teleport 到 body,需非 scoped) */
+.cursor-probe-dialog .el-message-box__message {
+ padding: 12px 8px 4px;
+}
+.cursor-probe-dialog .cursor-probe-result {
+ margin: 0;
+ text-align: center;
+ font-size: 16px;
+ line-height: 1.6;
+ font-weight: 600;
+ word-break: break-all;
+}
diff --git a/src/views/accountpool/kiro/index.vue b/src/views/accountpool/kiro/index.vue
index 2b8e562..f607418 100644
--- a/src/views/accountpool/kiro/index.vue
+++ b/src/views/accountpool/kiro/index.vue
@@ -14,6 +14,7 @@ import {
getAccountPoolList,
updateAccountPoolRemark,
replenishAccountPool,
+ probeAccountPoolToken,
} from '@/api/accountPool';
const moduleKey = "krio";
@@ -41,6 +42,7 @@ const total = ref(0);
const selectedRows = ref([]);
const detailRow = ref(null);
const detailRemarkSaving = ref(false);
+const probeLoadingId = ref(null);
const isMobile = ref(false);
const pagination = reactive({ page: 1, pageSize: 30 });
@@ -454,6 +456,31 @@ function copyCardInfo(row) {
navigator.clipboard.writeText(parts.join('\n')).then(() => { ElMessage.success('已复制'); });
}
+async function handleProbeToken(row) {
+ if (!row?.token) {
+ ElMessage.warning('该行无 Token');
+ return;
+ }
+ probeLoadingId.value = row.id;
+ try {
+ const res = await probeAccountPoolToken(moduleKey, { id: row.id });
+ if (res?.code !== 200) {
+ ElMessage.error(res?.msg || '探测失败');
+ return;
+ }
+ const d = res?.data || {};
+ if (d.ok) {
+ ElMessage.success(d.detail || '官方接口响应正常');
+ } else {
+ ElMessage.error(d.detail || '不可用或校验失败');
+ }
+ } catch {
+ ElMessage.error('探测请求失败');
+ } finally {
+ probeLoadingId.value = null;
+ }
+}
+
@@ -543,11 +570,19 @@ function copyCardInfo(row) {
-
-
+
详情
+ 查可用
{ ElMessage.success('已复制'); });
}
+async function handleProbeToken(row) {
+ if (!row?.token) {
+ ElMessage.warning('该行无 Token');
+ return;
+ }
+ probeLoadingId.value = row.id;
+ try {
+ const res = await probeAccountPoolToken(moduleKey, { id: row.id });
+ if (res?.code !== 200) {
+ ElMessage.error(res?.msg || '探测失败');
+ return;
+ }
+ const d = res?.data || {};
+ if (d.ok) {
+ ElMessage.success(d.detail || '官方接口响应正常');
+ } else {
+ ElMessage.error(d.detail || '不可用或校验失败');
+ }
+ } catch {
+ ElMessage.error('探测请求失败');
+ } finally {
+ probeLoadingId.value = null;
+ }
+}
+
@@ -542,11 +569,19 @@ function copyCardInfo(row) {
-
-
+
详情
+ 查可用