|
|
@@ -4,17 +4,24 @@ import { HoverButton, SvgIcon, UserAvatar } from '@/components/common'
|
|
|
import { NButton } from 'naive-ui'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
import { useBasicLayout } from '@/hooks/useBasicLayout'
|
|
|
-import { useAppStore } from '@/store'
|
|
|
+import { useAppStore, useUserStore } from '@/store'
|
|
|
import { emitter } from '@/plugins'
|
|
|
-
|
|
|
-const Setting = defineAsyncComponent(() => import('@/components/common/Setting/SettingIndex.vue'))
|
|
|
+import { storeToRefs } from 'pinia'
|
|
|
+import Setting from '@/components/common/Setting/SettingIndex.vue'
|
|
|
+import { inject } from 'vue'
|
|
|
|
|
|
const show = ref(false)
|
|
|
|
|
|
const { isMobile } = useBasicLayout()
|
|
|
const router = useRouter()
|
|
|
const appStore = useAppStore()
|
|
|
+const { userInfo } = storeToRefs(useUserStore())
|
|
|
+const login: any = inject('login')
|
|
|
function goMine() {
|
|
|
+ if (!userInfo.value?.id) {
|
|
|
+ login()
|
|
|
+ return
|
|
|
+ }
|
|
|
if (isMobile.value) {
|
|
|
router.push({
|
|
|
name: 'mine'
|
|
|
@@ -39,6 +46,6 @@ function goMine() {
|
|
|
</span>
|
|
|
</HoverButton>
|
|
|
|
|
|
- <Setting v-if="show" v-model:visible="show" />
|
|
|
+ <Setting v-model:visible="show" />
|
|
|
</footer>
|
|
|
</template>
|