From 915fa386a7ffbcb526e367703b34e22368fd22e1 Mon Sep 17 00:00:00 2001 From: kunkka Date: Mon, 19 Oct 2020 11:11:33 +0800 Subject: [PATCH 1/4] fix: add no-referrer to avoid CROB --- public/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/public/index.html b/public/index.html index 025b89a..91e96b7 100644 --- a/public/index.html +++ b/public/index.html @@ -4,6 +4,7 @@ + <%= htmlWebpackPlugin.options.title %> From 19a5269d5c6c0486fa1cb25cab9e4b16291347f4 Mon Sep 17 00:00:00 2001 From: kunkka Date: Mon, 19 Oct 2020 11:52:10 +0800 Subject: [PATCH 2/4] fix: setCookie and fix typo --- src/views/loginAccount.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/loginAccount.vue b/src/views/loginAccount.vue index c335d67..8edfd64 100644 --- a/src/views/loginAccount.vue +++ b/src/views/loginAccount.vue @@ -112,6 +112,7 @@ export default { methods: { ...mapMutations(["updateUser", "updateUserInfo"]), afterLogin() { + Cookies.set("MUSIC_U", true, { expires: 3650 }); Cookies.set("loginMode", "account", { expires: 3650 }); userPlaylist({ uid: this.$store.state.settings.user.userId, @@ -128,7 +129,7 @@ export default { this.processing = true; if (this.mode === "phone") { if ( - this.countrycode === "" || + this.countryCode === "" || this.phone === "" || this.password === "" ) { From c39bea4a4a6c09671ac59d9672f8227dc625e217 Mon Sep 17 00:00:00 2001 From: Hawtim Zhang Date: Mon, 19 Oct 2020 13:57:25 +0800 Subject: [PATCH 3/4] add .editorconfig for better coding (#14) * feat: add config to resolve path alias. * feat: add .editorconfig for ide * fix: add no-referrer to avoid CROB * fix: setCookie and fix typo --- .editorconfig | 8 ++++++++ public/index.html | 1 + src/views/loginAccount.vue | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..db87e1f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +charset = utf-8 +trim_trailing_whitespace = false +insert_final_newline = false \ No newline at end of file diff --git a/public/index.html b/public/index.html index 025b89a..91e96b7 100644 --- a/public/index.html +++ b/public/index.html @@ -4,6 +4,7 @@ + <%= htmlWebpackPlugin.options.title %> diff --git a/src/views/loginAccount.vue b/src/views/loginAccount.vue index c335d67..8edfd64 100644 --- a/src/views/loginAccount.vue +++ b/src/views/loginAccount.vue @@ -112,6 +112,7 @@ export default { methods: { ...mapMutations(["updateUser", "updateUserInfo"]), afterLogin() { + Cookies.set("MUSIC_U", true, { expires: 3650 }); Cookies.set("loginMode", "account", { expires: 3650 }); userPlaylist({ uid: this.$store.state.settings.user.userId, @@ -128,7 +129,7 @@ export default { this.processing = true; if (this.mode === "phone") { if ( - this.countrycode === "" || + this.countryCode === "" || this.phone === "" || this.password === "" ) { From 00774d3a9133c5134fa301dbd242961655c10e11 Mon Sep 17 00:00:00 2001 From: qier222 <68148142+qier222@users.noreply.github.com> Date: Mon, 19 Oct 2020 16:32:20 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=B0=83=E6=95=B4tracklist=E7=9A=84?= =?UTF-8?q?=E4=B8=93=E8=BE=91=E5=B0=81=E9=9D=A2=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Player.vue | 27 +++++++++++++++------------ src/components/TrackListItem.vue | 14 +++++++------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/components/Player.vue b/src/components/Player.vue index d6994dd..f697333 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -17,7 +17,10 @@
- +
{{ currentTrack.name }} @@ -125,13 +128,13 @@ export default { name: "Player", components: { ButtonIcon, - VueSlider, + VueSlider }, data() { return { interval: null, progress: 0, - oldVolume: 0.5, + oldVolume: 0.5 }; }, created() { @@ -139,7 +142,7 @@ export default { this.progress = ~~this.howler.seek(); }, 1000); if (this.isLoggedIn) { - userLikedSongsIDs(this.settings.user.userId).then((data) => { + userLikedSongsIDs(this.settings.user.userId).then(data => { this.updateLikedSongs(data.ids); }); } @@ -156,7 +159,7 @@ export default { set(value) { this.updatePlayerState({ key: "volume", value }); Howler.volume(value); - }, + } }, playing() { if (this.howler.state() === "loading") { @@ -170,7 +173,7 @@ export default { }, isLoggedIn() { return isLoggedIn(); - }, + } }, methods: { ...mapMutations([ @@ -178,13 +181,13 @@ export default { "turnOffShuffleMode", "updatePlayerState", "updateRepeatStatus", - "updateLikedSongs", + "updateLikedSongs" ]), ...mapActions([ "nextTrack", "previousTrack", "playTrackOnListByID", - "addNextTrackEvent", + "addNextTrackEvent" ]), play() { if (this.playing) { @@ -253,7 +256,7 @@ export default { if (this.liked.songs.includes(id)) like = false; likeATrack({ id, like }).then(() => { if (like === false) { - this.updateLikedSongs(this.liked.songs.filter((d) => d !== id)); + this.updateLikedSongs(this.liked.songs.filter(d => d !== id)); } else { let newLikeSongs = this.liked.songs; newLikeSongs.push(id); @@ -266,7 +269,7 @@ export default { this.$router.push({ path: "/library/liked-songs" }); else this.$router.push({ - path: "/" + this.player.listInfo.type + "/" + this.player.listInfo.id, + path: "/" + this.player.listInfo.type + "/" + this.player.listInfo.id }); }, goToAlbum() { @@ -274,8 +277,8 @@ export default { }, goToArtist(id) { this.$router.push({ path: "/artist/" + id }); - }, - }, + } + } }; diff --git a/src/components/TrackListItem.vue b/src/components/TrackListItem.vue index ab6c858..d81fe6f 100644 --- a/src/components/TrackListItem.vue +++ b/src/components/TrackListItem.vue @@ -6,7 +6,7 @@ @mouseover="focus = true" @mouseleave="focus = false" > - +