11
This commit is contained in:
36
src/config/api.ts
Normal file
36
src/config/api.ts
Normal 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'
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user