Files
mp-xieyingeng/assets/scripts/config/ApiConfig.ts
2026-04-05 13:37:58 +08:00

30 lines
773 B
TypeScript

/**
* API 配置常量
* 统一管理所有服务端 API 地址
*/
/** 服务端 API 基础地址 */
export const API_BASE = 'https://ilookai.cn/api/v1';
/** API 端点 */
export const API_ENDPOINTS = {
WX_LOGIN: `${API_BASE}/auth/wx-login`,
USER_ASSETS: `${API_BASE}/user/assets`,
USER_ASSETS_CONSUME: `${API_BASE}/user/assets/consume`,
USER_ASSETS_EARN: `${API_BASE}/user/assets/earn`,
USER_GAME_DATA: `${API_BASE}/user/game-data`,
LEVELS: `${API_BASE}/wechat-game/levels`,
} as const;
/** 积分操作原因 */
export const POINT_REASONS = {
HINT_UNLOCK: 'hint_unlock',
LEVEL_COMPLETE: 'level_complete',
} as const;
/** 请求超时时间(毫秒) */
export const API_TIMEOUT = {
DEFAULT: 8000,
SHORT: 5000,
} as const;