|
@@ -12,9 +12,9 @@ import type { Annotation } from '../atoms/annotation-atoms';
|
|
|
import { toast } from './toast';
|
|
import { toast } from './toast';
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * API base URL - defaults to localhost:8002 for development
|
|
|
|
|
|
|
+ * API base URL - 生产环境使用相对路径,开发环境使用 localhost
|
|
|
*/
|
|
*/
|
|
|
-const API_BASE_URL = process.env.NX_API_BASE_URL || 'http://localhost:8003';
|
|
|
|
|
|
|
+const API_BASE_URL = process.env.NX_API_BASE_URL || '';
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Axios instance with default configuration
|
|
* Axios instance with default configuration
|
|
@@ -183,7 +183,7 @@ apiClient.interceptors.response.use(
|
|
|
|
|
|
|
|
// Call refresh token endpoint
|
|
// Call refresh token endpoint
|
|
|
const response = await axios.post(
|
|
const response = await axios.post(
|
|
|
- `${API_BASE_URL}/api/auth/refresh`,
|
|
|
|
|
|
|
+ `${API_BASE_URL || window.location.origin}/api/auth/refresh`,
|
|
|
{
|
|
{
|
|
|
refresh_token: tokens.refresh_token,
|
|
refresh_token: tokens.refresh_token,
|
|
|
}
|
|
}
|