diff --git a/src/api.ts b/src/api.ts index b1553b1..dc4bf75 100644 --- a/src/api.ts +++ b/src/api.ts @@ -4,7 +4,7 @@ const AURA_API_BASE = 'https://api.redhare.cc/aura/v1'; const isMockAuth = () => typeof localStorage !== 'undefined' && localStorage.getItem('mock-auth') === '1'; export const api = axios.create({ - baseURL: 'https://api.redhare.cc/aura/v1', + baseURL: 'https://api.hoyidata.com/aura/v1', timeout: 90000, withCredentials: true // 关键:跨域请求带 cookie }); @@ -369,7 +369,7 @@ export const AuthAPI = { verify: async (email: string, password: string) => { // 根据要求,这里直接请求真实地址,未启动时 mock 返回 true try { - const res = await axios.post('https://api.redhare.cc/aura/v1/urser', { email, password }, { timeout: 3000 }); + const res = await axios.post('https://api.hoyidata.com/aura/v1/urser', { email, password }, { timeout: 3000 }); return res.data; } catch (e) { console.warn('Backend /urser not available, fallback to mock true', e); @@ -540,7 +540,7 @@ export async function streamChat( attachmentsText?: string, imageUrls?: string[] ) { - const resp = await fetch(`https://api.redhare.cc/aura/v1/chat/${agentId}/messages/stream`, { + const resp = await fetch(`https://api.hoyidata.com/aura/v1/chat/${agentId}/messages/stream`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -565,7 +565,7 @@ export async function regenerateMessage( overrides?: ModelOverrides, attachmentsText?: string ) { - const resp = await fetch(`https://api.redhare.cc/aura/v1/chat/${agentId}/messages/${messageId}/regenerate`, { + const resp = await fetch(`https://api.hoyidata.com/aura/v1/chat/${agentId}/messages/${messageId}/regenerate`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ overrides, attachmentsText }), diff --git a/vite.config.ts b/vite.config.ts index 1670a71..d4e221e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,7 +4,7 @@ import react from '@vitejs/plugin-react'; // 默认走 Go 后端 :4001;要回退 Node 后端就 set VITE_API_TARGET=http://localhost:4000 export default defineConfig(({ mode }) => { const env = loadEnv(mode, process.cwd(), ''); - const target = env.VITE_API_TARGET || 'https://api.redhare.cc'; + const target = env.VITE_API_TARGET || 'https://api.hoyidata.com'; return { plugins: [react()], server: {