This commit is contained in:
张成
2025-09-06 23:16:42 +08:00
parent c78be00ded
commit 24b957fad4
15 changed files with 2902 additions and 0 deletions

36
src/config/api.ts Normal file
View File

@@ -0,0 +1,36 @@
// API配置
export const API_CONFIG = {
// 基础URL
BASE_URL: process.env.NODE_ENV === 'development' ? 'http://localhost:3000' : 'https://api.example.com',
// 用户相关接口
USER: {
DETAIL: '/user/detail',
UPDATE: '/user/update',
FOLLOW: '/user/follow',
UNFOLLOW: '/user/unfollow'
},
// 文件上传接口
UPLOAD: {
AVATAR: '/gallery/upload',
IMAGE: '/gallery/upload'
},
// 球局相关接口
GAME: {
LIST: '/game/list',
DETAIL: '/game/detail',
CREATE: '/game/create',
JOIN: '/game/join',
LEAVE: '/game/leave'
}
};
// 请求拦截器配置
export const REQUEST_CONFIG = {
timeout: 10000,
header: {
'Content-Type': 'application/json'
}
};