chore(api): change all production api endpoints to hoyidata.com
parent
c03e54867f
commit
d336ea50af
|
|
@ -4,7 +4,7 @@ const AURA_API_BASE = 'https://api.redhare.cc/aura/v1';
|
||||||
const isMockAuth = () => typeof localStorage !== 'undefined' && localStorage.getItem('mock-auth') === '1';
|
const isMockAuth = () => typeof localStorage !== 'undefined' && localStorage.getItem('mock-auth') === '1';
|
||||||
|
|
||||||
export const api = axios.create({
|
export const api = axios.create({
|
||||||
baseURL: 'https://api.redhare.cc/aura/v1',
|
baseURL: 'https://api.hoyidata.com/aura/v1',
|
||||||
timeout: 90000,
|
timeout: 90000,
|
||||||
withCredentials: true // 关键:跨域请求带 cookie
|
withCredentials: true // 关键:跨域请求带 cookie
|
||||||
});
|
});
|
||||||
|
|
@ -369,7 +369,7 @@ export const AuthAPI = {
|
||||||
verify: async (email: string, password: string) => {
|
verify: async (email: string, password: string) => {
|
||||||
// 根据要求,这里直接请求真实地址,未启动时 mock 返回 true
|
// 根据要求,这里直接请求真实地址,未启动时 mock 返回 true
|
||||||
try {
|
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;
|
return res.data;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn('Backend /urser not available, fallback to mock true', e);
|
console.warn('Backend /urser not available, fallback to mock true', e);
|
||||||
|
|
@ -540,7 +540,7 @@ export async function streamChat(
|
||||||
attachmentsText?: string,
|
attachmentsText?: string,
|
||||||
imageUrls?: 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',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
|
@ -565,7 +565,7 @@ export async function regenerateMessage(
|
||||||
overrides?: ModelOverrides,
|
overrides?: ModelOverrides,
|
||||||
attachmentsText?: string
|
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',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({ overrides, attachmentsText }),
|
body: JSON.stringify({ overrides, attachmentsText }),
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import react from '@vitejs/plugin-react';
|
||||||
// 默认走 Go 后端 :4001;要回退 Node 后端就 set VITE_API_TARGET=http://localhost:4000
|
// 默认走 Go 后端 :4001;要回退 Node 后端就 set VITE_API_TARGET=http://localhost:4000
|
||||||
export default defineConfig(({ mode }) => {
|
export default defineConfig(({ mode }) => {
|
||||||
const env = loadEnv(mode, process.cwd(), '');
|
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 {
|
return {
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
server: {
|
server: {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue