github.com/e154/smart-home@v0.17.2-0.20240311175135-e530a6e5cd45/static_source/admin/src/views/Dashboard/landing.vue (about) 1 <script setup lang="ts"> 2 import View from "@/views/Dashboard/view/view.vue"; 3 import {useRoute} from "vue-router"; 4 import {ElEmpty} from "element-plus"; 5 import {useAppStore} from "@/store/modules/app"; 6 7 const appStore = useAppStore() 8 const route = useRoute(); 9 10 const dashboardId = parseInt(route.params.id as string) as number 11 const accessToken = route.query.access_token as string 12 const serverId = route.query.serverId as string 13 14 if (accessToken && !appStore.getToken) { 15 appStore.SetToken(accessToken) 16 } 17 if (appStore.getIsGate && serverId) { 18 appStore.setServerId(serverId) 19 } 20 21 </script> 22 23 <template> 24 <View v-if="dashboardId" :id="dashboardId"/> 25 <ElEmpty v-if="!dashboardId" :rows="5"/> 26 </template> 27 28 <style lang="less" scoped> 29 30 </style>