mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-05-17 10:27:30 +08:00
🔧 feat: 更新依赖版本 修复类型错误 优化首页推荐样式
This commit is contained in:
@@ -84,10 +84,10 @@ onBeforeUnmount(() => {
|
||||
});
|
||||
|
||||
// 是否扫码登陆
|
||||
const chooseQr = () => {
|
||||
isQr.value = !isQr.value;
|
||||
loadLogin();
|
||||
};
|
||||
// const chooseQr = () => {
|
||||
// isQr.value = !isQr.value;
|
||||
// loadLogin();
|
||||
// };
|
||||
|
||||
// 手机号登录
|
||||
const phone = ref('');
|
||||
|
||||
@@ -461,7 +461,6 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { cloneDeep } from 'lodash';
|
||||
import type { FormRules } from 'naive-ui';
|
||||
import { useMessage } from 'naive-ui';
|
||||
import { computed, h, nextTick, onMounted, ref, watch } from 'vue';
|
||||
@@ -494,23 +493,19 @@ const updateInfo = ref<UpdateResult>({
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const setData = ref(settingsStore.setData);
|
||||
// 使用计算属性来管理设置数据
|
||||
const setData = computed({
|
||||
get: () => settingsStore.setData,
|
||||
set: (newData) => {
|
||||
settingsStore.setSetData(newData);
|
||||
}
|
||||
});
|
||||
|
||||
const isDarkTheme = computed({
|
||||
get: () => settingsStore.theme === 'dark',
|
||||
set: () => settingsStore.toggleTheme()
|
||||
});
|
||||
|
||||
// watch(
|
||||
// () => setData.value,
|
||||
// (newData) => {
|
||||
// console.log('newData', newData);
|
||||
// settingsStore.setSetData(newData);
|
||||
// },
|
||||
// {
|
||||
// deep: true
|
||||
// }
|
||||
// );
|
||||
|
||||
const openAuthor = () => {
|
||||
window.open(setData.value.authorUrl);
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="user-page">
|
||||
<div
|
||||
v-if="userDetail"
|
||||
v-if="userDetail && user"
|
||||
class="left"
|
||||
:class="setAnimationClass('animate__fadeInLeft')"
|
||||
:style="{ backgroundImage: `url(${getImgUrl(user.backgroundUrl)})` }"
|
||||
@@ -167,6 +167,8 @@ const loadData = async () => {
|
||||
try {
|
||||
infoLoading.value = true;
|
||||
|
||||
if (!user.value) return;
|
||||
|
||||
const { data: userData } = await getUserDetail(user.value.userId);
|
||||
if (!mounted.value) return;
|
||||
userDetail.value = userData;
|
||||
@@ -186,7 +188,7 @@ const loadData = async () => {
|
||||
console.error('加载用户页面失败:', error);
|
||||
// 如果获取用户数据失败,可能是token过期
|
||||
if (error.response?.status === 401) {
|
||||
userStore.logout();
|
||||
userStore.handleLogout();
|
||||
router.push('/login');
|
||||
}
|
||||
} finally {
|
||||
@@ -214,7 +216,7 @@ watch(
|
||||
(newUser) => {
|
||||
if (!mounted.value) return;
|
||||
if (newUser) {
|
||||
loadUserData();
|
||||
loadPage();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user