mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-05-18 03:17:29 +08:00
🐞 fix: 修复菜单问题
This commit is contained in:
@@ -64,11 +64,19 @@ const loadHotSearchKeyword = async () => {
|
|||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
const user = localStorage.getItem('user')
|
const user = localStorage.getItem('user')
|
||||||
store.state.user = user ? JSON.parse(user) : null
|
store.state.user = user ? JSON.parse(user) : null
|
||||||
if(!user){
|
|
||||||
userSetOptions.value = USER_SET_OPTIONS.filter(item => item.key !== 'logout')
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => store.state.user,
|
||||||
|
(newVal) => {
|
||||||
|
if (newVal) {
|
||||||
|
userSetOptions.value = USER_SET_OPTIONS
|
||||||
|
}else{
|
||||||
|
userSetOptions.value = USER_SET_OPTIONS.filter(item => item.key !== 'logout')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
const loadPage = async () => {
|
const loadPage = async () => {
|
||||||
const token = localStorage.getItem("token")
|
const token = localStorage.getItem("token")
|
||||||
if (!token) return
|
if (!token) return
|
||||||
|
|||||||
Reference in New Issue
Block a user