index.vue
1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<script setup lang="ts">
import { ref, onMounted, reactive, getCurrentInstance } from "vue";
import router from "@/router";
import { useLoginStore } from "@/pinia/login";
let instance: ComponentInternalInstance | null = getCurrentInstance();
const title = ref(import.meta.env.VITE_APP_TITLE).value;
let asyncData = reactive({
organizationLogo: "",
organizationName: "",
});
onMounted(() => {
asyncData.organizationLogo = useLoginStore()?.getOlogo;
asyncData.organizationName = useLoginStore()?.getOname;
});
</script>
<template>
<div class="dashboard-container">
<img
:src="
asyncData.organizationLogo
? asyncData.organizationLogo
: instance?.proxy?.$cnliveLogo
"
height="200"
/>
<h1>
欢迎访问 --
{{ asyncData.organizationName ? asyncData.organizationName : title }}
</h1>
</div>
</template>
<style lang="scss" scoped>
.dashboard {
&-container {
padding-top: 200px;
min-height: calc(100vh - 60px);
background: #f0f2f5;
text-align: center;
}
&-logo {
width: 200px;
height: 200px;
margin: 0 auto;
background-color: pink;
background-image: url("@/assets/logo.png");
background-repeat: no-repeat;
background-size: contain;
background-position: 0;
}
}
</style>