Files
AIEC-new/AIEC-server/config/api-config.js
2025-10-17 09:31:28 +08:00

41 lines
1.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 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;
}