feat: 登录状态校验功能修改

This commit is contained in:
alger
2025-09-14 00:34:35 +08:00
parent 8f9c989815
commit 8f0728d9db
5 changed files with 61 additions and 11 deletions
@@ -234,6 +234,7 @@ import { useDownload } from '@/hooks/useDownload';
import { useMusicStore, usePlayerStore, useRecommendStore } from '@/store';
import { SongResult } from '@/types/music';
import { getImgUrl, isElectron, isMobile, setAnimationClass } from '@/utils';
import { getLoginErrorMessage, hasPermission } from '@/utils/auth';
const { t } = useI18n();
const route = useRoute();
@@ -816,6 +817,12 @@ const checkCollectionStatus = () => {
const toggleCollect = async () => {
if (!listInfo.value?.id) return;
// 检查是否有真实登录权限
if (!hasPermission(true)) {
message.error(getLoginErrorMessage(true));
return;
}
try {
loadingList.value = true;
const tVal = isCollected.value ? 2 : 1; // 1:收藏, 2:取消收藏