[Claude Code] After prompt #0
This commit is contained in:
@@ -61,7 +61,7 @@ export function getAchievementIconUrl(icon?: string): string {
|
||||
* @returns 等级图标URL
|
||||
*/
|
||||
export function getLevelIconUrl(level = 1): string {
|
||||
const validLevel = Math.max(1, Math.min(6, level)); // 限制在1-6之间
|
||||
const validLevel = Math.floor(Math.max(1, Math.min(6, level))); // 限制在1-6之间
|
||||
return getIconUrl(`v${validLevel}-icon.svg`, 'achievement');
|
||||
}
|
||||
|
||||
@@ -81,7 +81,8 @@ export function getLevelStarIconUrl(level = 1): string {
|
||||
const floatLevel = parseFloat(level.toString());
|
||||
// 小数点后的值 .1到.5
|
||||
const decimal = floatLevel % 1;
|
||||
const val = decimal * 10;
|
||||
// 转int
|
||||
const val = Math.floor(decimal * 10);
|
||||
return getIconUrl(`v${val}-star.svg`, 'achievement');
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user