fix: 修复因为使用了electron的clipboard导致的异常 (#1582)

master
memorydream 3 years ago committed by GitHub
parent 21c7b5ae44
commit 5dd00bec87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -75,7 +75,6 @@ import { mapActions, mapMutations, mapState } from 'vuex';
import { addOrRemoveTrackFromPlaylist } from '@/api/playlist'; import { addOrRemoveTrackFromPlaylist } from '@/api/playlist';
import { cloudDiskTrackDelete } from '@/api/user'; import { cloudDiskTrackDelete } from '@/api/user';
import { isAccountLoggedIn } from '@/utils/auth'; import { isAccountLoggedIn } from '@/utils/auth';
const { clipboard } = require('electron');
import TrackListItem from '@/components/TrackListItem.vue'; import TrackListItem from '@/components/TrackListItem.vue';
import ContextMenu from '@/components/ContextMenu.vue'; import ContextMenu from '@/components/ContextMenu.vue';
@ -270,7 +269,7 @@ export default {
} }
}, },
copyLink() { copyLink() {
clipboard.writeText( navigator.clipboard.writeText(
`https://music.163.com/song?id=${this.rightClickedTrack.id}` `https://music.163.com/song?id=${this.rightClickedTrack.id}`
); );
this.showToast(locale.t('toast.copied')); this.showToast(locale.t('toast.copied'));

Loading…
Cancel
Save