[Claude Code] After prompt #0

This commit is contained in:
2025-11-25 17:55:23 +08:00
parent e272dc5e79
commit b51350c1f0
2 changed files with 3 additions and 3 deletions

View File

@@ -61,7 +61,7 @@ export function getAchievementIconUrl(icon?: string): string {
* @returns 等级图标URL * @returns 等级图标URL
*/ */
export function getLevelIconUrl(level = 1): string { 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'); return getIconUrl(`v${validLevel}-icon.svg`, 'achievement');
} }
@@ -81,7 +81,8 @@ export function getLevelStarIconUrl(level = 1): string {
const floatLevel = parseFloat(level.toString()); const floatLevel = parseFloat(level.toString());
// 小数点后的值 .1到.5 // 小数点后的值 .1到.5
const decimal = floatLevel % 1; const decimal = floatLevel % 1;
const val = decimal * 10; // 转int
const val = Math.floor(decimal * 10);
return getIconUrl(`v${val}-star.svg`, 'achievement'); return getIconUrl(`v${val}-star.svg`, 'achievement');
} }

View File

@@ -50,7 +50,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">