mirror of
https://github.com/cnlimiter/codex-register.git
synced 2026-09-05 23:47:33 +08:00
feat(accounts): 添加账号cookies存储及支付链接国家选择功能
- 在账号详情页添加cookies编辑与保存功能,用于支付请求 - 支付页面新增国家选择下拉框,支持多国货币计费 - 优化无痕打开浏览器功能,支持注入账号cookies - 更新数据库模型、API路由及前端界面
This commit is contained in:
@@ -613,6 +613,17 @@ async function viewAccount(id) {
|
||||
${tokens.refresh_token ? `<button class="btn btn-ghost btn-sm" onclick="copyToClipboard('${escapeHtml(tokens.refresh_token)}')" style="margin-left: 8px;">📋</button>` : ''}
|
||||
</div>
|
||||
</div>
|
||||
<div class="info-item" style="grid-column: span 2;">
|
||||
<span class="label">Cookies(支付用)</span>
|
||||
<div class="value">
|
||||
<textarea id="cookies-input-${id}" rows="3"
|
||||
style="width:100%;font-size:0.7rem;font-family:var(--font-mono);background:var(--surface-hover);border:1px solid var(--border);border-radius:4px;padding:6px;color:var(--text-primary);resize:vertical;"
|
||||
placeholder="粘贴完整 cookie 字符串,留空则清除">${escapeHtml(account.cookies || '')}</textarea>
|
||||
<button class="btn btn-secondary btn-sm" style="margin-top:4px" onclick="saveCookies(${id})">
|
||||
保存 Cookies
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: var(--spacing-lg); display: flex; gap: var(--spacing-sm);">
|
||||
<button class="btn btn-primary" onclick="refreshToken(${id}); elements.detailModal.classList.remove('active');">
|
||||
@@ -861,3 +872,16 @@ async function handleBatchUploadTm() {
|
||||
updateBatchButtons();
|
||||
}
|
||||
}
|
||||
|
||||
// 保存账号 Cookies
|
||||
async function saveCookies(id) {
|
||||
const textarea = document.getElementById(`cookies-input-${id}`);
|
||||
if (!textarea) return;
|
||||
const cookiesValue = textarea.value.trim();
|
||||
try {
|
||||
await api.patch(`/accounts/${id}`, { cookies: cookiesValue });
|
||||
toast.success('Cookies 已保存');
|
||||
} catch (e) {
|
||||
toast.error('保存 Cookies 失败: ' + e.message);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user