* @description 刷新分数信息
()
| 4468 | * @description 刷新分数信息 |
| 4469 | */ |
| 4470 | async function refreshScoreInfo() { |
| 4471 | // 未登录 |
| 4472 | if (!login.value) { |
| 4473 | throw new Error('用户未登录!'); |
| 4474 | } |
| 4475 | log('加载分数信息...'); |
| 4476 | // 获取总分 |
| 4477 | const totalScoreRes = await getTotalScore(); |
| 4478 | // 获取当天总分 |
| 4479 | const todayScoreRes = await getTodayScore(); |
| 4480 | // 整数值 |
| 4481 | if (Number.isInteger(totalScoreRes) && Number.isInteger(todayScoreRes)) { |
| 4482 | // 设置分数 |
| 4483 | totalScore.value = totalScoreRes; |
| 4484 | todayScore.value = todayScoreRes; |
| 4485 | return true; |
| 4486 | } |
| 4487 | log('加载分数信息失败!'); |
| 4488 | return false; |
| 4489 | } |
| 4490 | /** |
| 4491 | * @description 刷新任务列表 |
| 4492 | */ |
no test coverage detected