feat: 支持通关字段上报

This commit is contained in:
richarjiang
2026-04-07 15:46:22 +08:00
parent b489ab40f5
commit e05a6a1f8c
3 changed files with 37 additions and 8 deletions

View File

@@ -85,9 +85,11 @@ export class UserAssetsManager {
/**
* 获得积分(通关奖励)
* @param levelId 关卡ID
* @param timeSpent 通关耗时(秒)
* @returns 获得后的积分数
*/
async earnPoint(levelId: string): Promise<number> {
async earnPoint(levelId: string, timeSpent: number): Promise<number> {
if (!AuthManager.instance.isLoggedIn) {
StorageManager.addPoint();
return StorageManager.getPoints();
@@ -99,6 +101,7 @@ export class UserAssetsManager {
{
reason: POINT_REASONS.LEVEL_COMPLETE,
levelId,
timeSpent,
},
API_TIMEOUT.SHORT
);