first commit
This commit is contained in:
41
AIEC-server/config/api-config.js
Normal file
41
AIEC-server/config/api-config.js
Normal file
@ -0,0 +1,41 @@
|
||||
/**
|
||||
* API配置文件 - 用于连接到Spring Boot后端
|
||||
*/
|
||||
|
||||
const API_CONFIG = {
|
||||
// Spring Boot 后端服务地址
|
||||
BASE_URL: 'http://101.200.154.78:8080',
|
||||
|
||||
// API 路径配置
|
||||
ENDPOINTS: {
|
||||
// 认证相关
|
||||
AUTH: {
|
||||
SEND_CODE: '/api/auth/send-code',
|
||||
LOGIN: '/api/auth/login',
|
||||
REGISTER: '/api/auth/register',
|
||||
LOGOUT: '/api/auth/logout',
|
||||
REFRESH: '/api/auth/refresh',
|
||||
FORGOT_PASSWORD: '/api/auth/forgot-password',
|
||||
RESET_PASSWORD: '/api/auth/reset-password'
|
||||
},
|
||||
|
||||
// 用户相关
|
||||
USER: {
|
||||
ME: '/api/users/me', // 注意:backserver使用/api/users而不是/api/user
|
||||
UPDATE_PROFILE: '/api/users/profile'
|
||||
}
|
||||
},
|
||||
|
||||
// 请求超时设置
|
||||
TIMEOUT: 30000,
|
||||
|
||||
// 获取完整的API URL
|
||||
getUrl(endpoint) {
|
||||
return `${this.BASE_URL}${endpoint}`;
|
||||
}
|
||||
};
|
||||
|
||||
// 导出配置
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
module.exports = API_CONFIG;
|
||||
}
|
||||
Reference in New Issue
Block a user