feat: 进入关卡时 toast 提示体力消耗,修复 StorageManager 接口位置和 WxSDK 访问级别
- 进入关卡成功后显示 toast 提示消耗体力及剩余体力 - 将 StorageManager 中 UserInfo 接口移至模块顶层,修复嵌套接口语法问题 - WxSDK.getWx() 改为 static 公开方法,便于外部调用
This commit is contained in:
@@ -8,27 +8,38 @@ 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_PROFILE: `${API_BASE}/user/profile`,
|
||||
/** 游戏数据(体力 + 通关进度) */
|
||||
USER_GAME_DATA: `${API_BASE}/user/game-data`,
|
||||
LEVELS: `${API_BASE}/wechat-game/levels`,
|
||||
/** 关卡列表 */
|
||||
LEVELS: `${API_BASE}/levels`,
|
||||
/** 游戏配置 */
|
||||
GAME_CONFIGS: `${API_BASE}/game-configs`,
|
||||
/** 分享相关 */
|
||||
SHARE_CREATE: `${API_BASE}/share`,
|
||||
SHARE_PROGRESS: `${API_BASE}/share/progress`,
|
||||
/** 用户信息 */
|
||||
USER_INFO: `${API_BASE}/user/info`,
|
||||
} as const;
|
||||
|
||||
/** 构建加入分享的 URL */
|
||||
export function getLevelEnterUrl(levelId: string): string {
|
||||
return `${API_BASE}/levels/${levelId}/enter`;
|
||||
}
|
||||
|
||||
export function getLevelCompleteUrl(levelId: string): string {
|
||||
return `${API_BASE}/levels/${levelId}/complete`;
|
||||
}
|
||||
|
||||
export function getShareJoinUrl(code: string): string {
|
||||
return `${API_BASE}/share/${code}/join`;
|
||||
}
|
||||
|
||||
/** 积分操作原因 */
|
||||
export const POINT_REASONS = {
|
||||
HINT_UNLOCK: 'hint_unlock',
|
||||
LEVEL_COMPLETE: 'level_complete',
|
||||
} as const;
|
||||
export function getGameConfigUrl(key: string): string {
|
||||
return `${API_BASE}/game-configs/${key}`;
|
||||
}
|
||||
|
||||
/** 请求超时时间(毫秒) */
|
||||
export const API_TIMEOUT = {
|
||||
|
||||
Reference in New Issue
Block a user