更新补号机制
This commit is contained in:
parent
2d075e6548
commit
1bed46e11b
@ -666,11 +666,20 @@ function copyCardInfo(row) {
|
||||
const CURSOR_PRO_LIMIT_TEXT = 'Get Cursor Pro for more Agent usage, unlimited Tab, and more.';
|
||||
|
||||
function formatCursorProbeDialogText(d) {
|
||||
// 1. 优先以新版后端的 ok 字段(也就是底层探针的交叉判定结论)为核心准则
|
||||
if (d && typeof d.ok === 'boolean') {
|
||||
return d.ok ? '该TOKEN可用' : `该TOKEN已用完 (${d.detail || '额度枯竭'})`;
|
||||
}
|
||||
|
||||
// 2. 兼容旧数据的兜底检测
|
||||
const CURSOR_PRO_LIMIT_TEXT = 'Get Cursor Pro for more Agent usage, unlimited Tab, and more.';
|
||||
const detail = String(d?.detail || '');
|
||||
const rawPreview = String(d?.rawPreview || '');
|
||||
|
||||
if (detail.includes(CURSOR_PRO_LIMIT_TEXT) || rawPreview.includes(CURSOR_PRO_LIMIT_TEXT)) {
|
||||
return '该TOKEN已用完';
|
||||
}
|
||||
|
||||
return '该TOKEN可用';
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user