This commit is contained in:
2025-07-08 23:42:53 +08:00
parent 22691d4dd6
commit ff802e00da
3 changed files with 8 additions and 8 deletions

View File

@@ -442,7 +442,7 @@ export const accountController = {
// Claude 登录处理 // Claude 登录处理
async function handleClaudeLogin(token: string, userName: string): Promise<string> { async function handleClaudeLogin(token: string, userName: string): Promise<string> {
try { try {
const baseUrl = process.env.CLAUDE_TARGET_URL || 'https://chat.micar9.com:8443'; const baseUrl = process.env.CLAUDE_TARGET_URL || 'https://chat.micar9.com';
console.log('Claude登录处理:', { token, userName }); console.log('Claude登录处理:', { token, userName });
// 第一步获取oauth token // 第一步获取oauth token
const oauthResponse = await fetch(`${baseUrl}/manage-api/auth/oauth_token`, { const oauthResponse = await fetch(`${baseUrl}/manage-api/auth/oauth_token`, {
@@ -476,7 +476,7 @@ async function handleClaudeLogin(token: string, userName: string): Promise<strin
// ChatGPT 登录处理 // ChatGPT 登录处理
async function handleChatGPTLogin(token: string, userName: string): Promise<string> { async function handleChatGPTLogin(token: string, userName: string): Promise<string> {
try { try {
const baseUrl = process.env.CLAUDE_TARGET_URL || 'http://127.0.0.1:8181'; const baseUrl = process.env.CHATGPT_TARGET_URL || 'http://127.0.0.1:8181';
const response = await fetch(`${baseUrl}/api/login`, { const response = await fetch(`${baseUrl}/api/login`, {
method: 'POST', method: 'POST',
@@ -512,7 +512,7 @@ async function handleChatGPTLogin(token: string, userName: string): Promise<stri
// Grok 登录处理 // Grok 登录处理
async function handleGrokLogin(token: string, userName: string): Promise<string> { async function handleGrokLogin(token: string, userName: string): Promise<string> {
try { try {
const baseUrl = process.env.CLAUDE_TARGET_URL || 'https://grok-mirror.micar9.com:8443'; const baseUrl = process.env.GROK_TARGET_URL || 'https://grok-mirror.micar9.com';
const response = await fetch(`${baseUrl}/api/login-v2`, { const response = await fetch(`${baseUrl}/api/login-v2`, {
method: 'POST', method: 'POST',

View File

@@ -22,7 +22,7 @@ services:
dockerfile: Dockerfile dockerfile: Dockerfile
container_name: pandora_frontend container_name: pandora_frontend
environment: environment:
CLAUDE_TARGET_URL: https://claude.micar9.com CLAUDE_TARGET_URL: https://chat.micar9.com
CHATGPT_TARGET_URL: https://gpt.micar9.com CHATGPT_TARGET_URL: https://gpt.micar9.com
GROK_TARGET_URL: https://grok-mirror.micar9.com GROK_TARGET_URL: https://grok-mirror.micar9.com
ports: ports:

View File

@@ -13,17 +13,17 @@ const getWebsiteUrls = () => {
if (typeof window !== 'undefined') { if (typeof window !== 'undefined') {
// 在客户端使用Vite注入的环境变量 // 在客户端使用Vite注入的环境变量
return { return {
claude: import.meta.env.CLAUDE_TARGET_URL || 'https://chat.micar9.com:8443', claude: import.meta.env.CLAUDE_TARGET_URL || 'https://chat.micar9.com',
chatgpt: import.meta.env.CHATGPT_TARGET_URL || 'https://chat.openai.com', chatgpt: import.meta.env.CHATGPT_TARGET_URL || 'https://chat.openai.com',
grok: import.meta.env.GROK_TARGET_URL || 'https://grok-mirror.micar9.com:8443' grok: import.meta.env.GROK_TARGET_URL || 'https://grok-mirror.micar9.com'
} }
} }
// 在服务端,使用环境变量 // 在服务端,使用环境变量
return { return {
claude: process.env.CLAUDE_TARGET_URL || 'https://chat.micar9.com:8443', claude: process.env.CLAUDE_TARGET_URL || 'https://chat.micar9.com',
chatgpt: process.env.CHATGPT_TARGET_URL || 'https://chat.openai.com', chatgpt: process.env.CHATGPT_TARGET_URL || 'https://chat.openai.com',
grok: process.env.GROK_TARGET_URL || 'https://grok-mirror.micar9.com:8443' grok: process.env.GROK_TARGET_URL || 'https://grok-mirror.micar9.com'
} }
} }