feat: 支持通关字段上报
This commit is contained in:
@@ -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
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user