mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-05-17 10:27:30 +08:00
feat: 登录状态校验功能修改
This commit is contained in:
@@ -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:取消收藏
|
||||
|
||||
Reference in New Issue
Block a user