fix bug
This commit is contained in:
@@ -442,7 +442,7 @@ export const accountController = {
|
||||
// Claude 登录处理
|
||||
async function handleClaudeLogin(token: string, userName: string): Promise<string> {
|
||||
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 });
|
||||
// 第一步:获取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 登录处理
|
||||
async function handleChatGPTLogin(token: string, userName: string): Promise<string> {
|
||||
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`, {
|
||||
method: 'POST',
|
||||
@@ -512,7 +512,7 @@ async function handleChatGPTLogin(token: string, userName: string): Promise<stri
|
||||
// Grok 登录处理
|
||||
async function handleGrokLogin(token: string, userName: string): Promise<string> {
|
||||
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`, {
|
||||
method: 'POST',
|
||||
|
||||
@@ -22,7 +22,7 @@ services:
|
||||
dockerfile: Dockerfile
|
||||
container_name: pandora_frontend
|
||||
environment:
|
||||
CLAUDE_TARGET_URL: https://claude.micar9.com
|
||||
CLAUDE_TARGET_URL: https://chat.micar9.com
|
||||
CHATGPT_TARGET_URL: https://gpt.micar9.com
|
||||
GROK_TARGET_URL: https://grok-mirror.micar9.com
|
||||
ports:
|
||||
|
||||
@@ -13,17 +13,17 @@ const getWebsiteUrls = () => {
|
||||
if (typeof window !== 'undefined') {
|
||||
// 在客户端,使用Vite注入的环境变量
|
||||
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',
|
||||
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 {
|
||||
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',
|
||||
grok: process.env.GROK_TARGET_URL || 'https://grok-mirror.micar9.com:8443'
|
||||
grok: process.env.GROK_TARGET_URL || 'https://grok-mirror.micar9.com'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user