🌈 style: 优化代码格式化

This commit is contained in:
alger
2025-01-10 22:49:55 +08:00
parent ddb814da10
commit 62e26cae7d
40 changed files with 450 additions and 239 deletions
+15 -11
View File
@@ -89,7 +89,7 @@
</template>
<script lang="ts" setup>
import { computed, ref, watch, onBeforeUnmount } from 'vue';
import { computed, onBeforeUnmount, ref, watch } from 'vue';
import { useRouter } from 'vue-router';
import { useStore } from 'vuex';
@@ -125,7 +125,7 @@ onBeforeUnmount(() => {
const loadPage = async () => {
if (!mounted.value || !user.value) return;
try {
infoLoading.value = true;
@@ -154,15 +154,19 @@ const loadPage = async () => {
};
// 监听用户状态变化
watch(() => store.state.user, (newUser) => {
if (!mounted.value) return;
if (!newUser) {
router.push('/login');
} else {
loadPage();
}
}, { immediate: true });
watch(
() => store.state.user,
(newUser) => {
if (!mounted.value) return;
if (!newUser) {
router.push('/login');
} else {
loadPage();
}
},
{ immediate: true }
);
// 展示歌单
const showPlaylist = async (id: number, name: string) => {