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

This commit is contained in:
memorydream 2022-04-30 17:24:13 +08:00 committed by GitHub
parent 21c7b5ae44
commit 5dd00bec87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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