(filename)
| 1602 | } |
| 1603 | |
| 1604 | async function verifyProjectId(filename) { |
| 1605 | try { |
| 1606 | // 显示加载状态 |
| 1607 | showStatus('🔍 正在检验Project ID,请稍候...', 'info'); |
| 1608 | |
| 1609 | const response = await fetch(`./creds/verify-project/${encodeURIComponent(filename)}`, { |
| 1610 | method: 'POST', |
| 1611 | headers: getAuthHeaders() |
| 1612 | }); |
| 1613 | const data = await response.json(); |
| 1614 | |
| 1615 | if (response.ok && data.success) { |
| 1616 | // 成功时显示绿色成功消息和Project ID |
| 1617 | const tierLine = data.subscription_tier ? `\nTier: ${data.subscription_tier}` : ''; |
| 1618 | const creditLine = data.credit_amount !== undefined && data.credit_amount !== null |
| 1619 | ? `\n积分: ${data.credit_amount}` |
| 1620 | : ''; |
| 1621 | const successMsg = `✅ 检验成功!\n文件: ${filename}\nProject ID: ${data.project_id}${tierLine}${creditLine}\n\n${data.message}`; |
| 1622 | showStatus(successMsg.replace(/\n/g, '<br>'), 'success'); |
| 1623 | |
| 1624 | // 弹出成功提示 |
| 1625 | showMessageModal('检验成功', `✅ 检验成功!\n\n文件: ${filename}\nProject ID: ${data.project_id}${tierLine}${creditLine}\n\n${data.message}`, 'success'); |
| 1626 | |
| 1627 | await AppState.creds.refresh(); |
| 1628 | } else { |
| 1629 | // 失败时显示红色错误消息 |
| 1630 | const errorMsg = data.message || '检验失败'; |
| 1631 | showStatus(`❌ ${errorMsg}`, 'error'); |
| 1632 | showMessageModal('检验失败', `❌ 检验失败\n\n${errorMsg}`, 'error'); |
| 1633 | } |
| 1634 | } catch (error) { |
| 1635 | const errorMsg = `检验失败: ${error.message}`; |
| 1636 | showStatus(`❌ ${errorMsg}`, 'error'); |
| 1637 | showMessageModal('检验失败', `❌ ${errorMsg}`, 'error'); |
| 1638 | } |
| 1639 | } |
| 1640 | |
| 1641 | async function verifyAntigravityProjectId(filename) { |
| 1642 | try { |
nothing calls this directly
no test coverage detected