成就
This commit is contained in:
@@ -108,6 +108,29 @@ export const achievementApi = {
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取当前用户的等级成就状态(当前等级 + 下一等级)
|
||||
* @returns Promise<ResultDomain<Record<string, any>>> { current: AchievementVO|null, next: AchievementVO|null }
|
||||
*/
|
||||
async getMyLevelStatus(): Promise<ResultDomain<Record<string, any>>> {
|
||||
const response = await api.get<Record<string, any>>('/achievements/my/level-status');
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取当前用户“已获得”的成就(不含未获得)
|
||||
* @param type 成就类型(可选)
|
||||
* @returns Promise<ResultDomain<UserAchievement>>
|
||||
*/
|
||||
async getMyObtainedAchievements(type?: number): Promise<ResultDomain<UserAchievement>> {
|
||||
const params: Record<string, any> = {};
|
||||
if (type !== undefined) {
|
||||
params.type = type;
|
||||
}
|
||||
const response = await api.get<UserAchievement>('/achievements/my/obtained', params);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* 检查用户是否已获得成就
|
||||
* @param userID 用户ID
|
||||
|
||||
Reference in New Issue
Block a user