fix
Some checks failed
Deploy / deploy (push) Has been cancelled

This commit is contained in:
2025-11-30 19:02:51 +08:00
parent eb0122ffc2
commit f0f9c74973
2 changed files with 8 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
import { Icon } from "@iconify/vue"
import { ProblemSet, UserBadge as UserBadgeType } from "utils/types"
import UserBadge from "shared/components/UserBadge.vue"
import { useUserStore } from "shared/store/user"
interface Props {
problemSet: ProblemSet
@@ -17,6 +18,8 @@ interface Emits {
const props = defineProps<Props>()
const emit = defineEmits<Emits>()
const userStore = useUserStore()
function getDifficultyTag(difficulty: string) {
const difficultyMap: Record<
string,
@@ -60,7 +63,7 @@ function handleJoin() {
</n-tooltip>
</n-flex>
<n-flex align="center">
<n-flex align="center" v-if="userStore.isAuthed">
<!-- 用户徽章显示区域 - 只在已加入且有徽章时显示 -->
<n-flex v-if="isJoined && userBadges.length > 0" align="center">
<n-text>已获徽章</n-text>

View File

@@ -63,6 +63,10 @@ async function init() {
}
async function handleProblemClick(problemId: string) {
if (!userStore.isAuthed) {
message.warning("请先登录!")
return
}
if (!isJoined.value) {
message.warning("请先点击【加入题单】按钮!")
return