feat: fix some code

This commit is contained in:
tim
2025-08-09 16:47:40 +08:00
parent 411d24194b
commit 6b5b6b8c81
2 changed files with 6 additions and 2 deletions

View File

@@ -26,7 +26,7 @@
<script setup>
import { ref, watch } from 'vue'
import { API_BASE_URL } from '../main'
import { API_BASE_URL, toast } from '../main'
const props = defineProps({
userId: {
@@ -41,6 +41,9 @@ const fetchMedals = async () => {
const res = await fetch(`${API_BASE_URL}/api/medals?userId=${props.userId}`)
if (res.ok) {
medals.value = await res.json()
} else {
medals.value = []
toast.error('获取成就失败')
}
}