diff --git a/app.js b/app.js index b2fd76c..f88b5e1 100644 --- a/app.js +++ b/app.js @@ -480,6 +480,7 @@ class CLIProxyManager { const iflowOauthBtn = document.getElementById('iflow-oauth-btn'); const iflowOpenLink = document.getElementById('iflow-open-link'); const iflowCopyLink = document.getElementById('iflow-copy-link'); + const iflowCookieSubmit = document.getElementById('iflow-cookie-submit'); if (iflowOauthBtn) { iflowOauthBtn.addEventListener('click', () => this.startIflowOAuth()); @@ -490,6 +491,9 @@ class CLIProxyManager { if (iflowCopyLink) { iflowCopyLink.addEventListener('click', () => this.copyIflowLink()); } + if (iflowCookieSubmit) { + iflowCookieSubmit.addEventListener('click', () => this.submitIflowCookieLogin()); + } // 使用统计 const refreshUsageStats = document.getElementById('refresh-usage-stats'); diff --git a/i18n.js b/i18n.js index 3df27ce..1290754 100644 --- a/i18n.js +++ b/i18n.js @@ -388,6 +388,20 @@ const i18n = { 'auth_login.iflow_oauth_status_error': '认证失败:', 'auth_login.iflow_oauth_start_error': '启动 iFlow OAuth 失败:', 'auth_login.iflow_oauth_polling_error': '检查认证状态失败:', + 'auth_login.iflow_cookie_title': 'iFlow Cookie 登录', + 'auth_login.iflow_cookie_label': 'Cookie 内容:', + 'auth_login.iflow_cookie_placeholder': '粘贴浏览器中的 Cookie,例如 sessionid=...;', + 'auth_login.iflow_cookie_hint': '直接提交 Cookie 以完成登录(无需打开授权链接),服务端将自动保存凭据。', + 'auth_login.iflow_cookie_button': '提交 Cookie 登录', + 'auth_login.iflow_cookie_status_success': 'Cookie 登录成功,凭据已保存。', + 'auth_login.iflow_cookie_status_error': 'Cookie 登录失败:', + 'auth_login.iflow_cookie_start_error': '提交 Cookie 登录失败:', + 'auth_login.iflow_cookie_required': '请先填写 Cookie 内容', + 'auth_login.iflow_cookie_result_title': 'Cookie 登录结果', + 'auth_login.iflow_cookie_result_email': '账号', + 'auth_login.iflow_cookie_result_expired': '过期时间', + 'auth_login.iflow_cookie_result_path': '保存路径', + 'auth_login.iflow_cookie_result_type': '类型', // 使用统计 'usage_stats.title': '使用统计', @@ -922,6 +936,20 @@ const i18n = { 'auth_login.iflow_oauth_status_error': 'Authentication failed:', 'auth_login.iflow_oauth_start_error': 'Failed to start iFlow OAuth:', 'auth_login.iflow_oauth_polling_error': 'Failed to check authentication status:', + 'auth_login.iflow_cookie_title': 'iFlow Cookie Login', + 'auth_login.iflow_cookie_label': 'Cookie Value:', + 'auth_login.iflow_cookie_placeholder': 'Paste browser cookie, e.g. sessionid=...;', + 'auth_login.iflow_cookie_hint': 'Submit an existing cookie to finish login without opening the authorization link; the credential file will be saved automatically.', + 'auth_login.iflow_cookie_button': 'Submit Cookie Login', + 'auth_login.iflow_cookie_status_success': 'Cookie login succeeded and credentials are saved.', + 'auth_login.iflow_cookie_status_error': 'Cookie login failed:', + 'auth_login.iflow_cookie_start_error': 'Failed to submit cookie login:', + 'auth_login.iflow_cookie_required': 'Please provide the Cookie value first.', + 'auth_login.iflow_cookie_result_title': 'Cookie Login Result', + 'auth_login.iflow_cookie_result_email': 'Account', + 'auth_login.iflow_cookie_result_expired': 'Expires At', + 'auth_login.iflow_cookie_result_path': 'Saved Path', + 'auth_login.iflow_cookie_result_type': 'Type', // Usage Statistics 'usage_stats.title': 'Usage Statistics', diff --git a/index.html b/index.html index 3fc0b1d..4e2e8a3 100644 --- a/index.html +++ b/index.html @@ -778,6 +778,34 @@
++ 直接提交 Cookie 完成登录并保存凭据,无需打开授权链接。 +
+