index.vue 1.36 KB
<script setup lang="ts">
import { ref, onMounted, reactive } from "vue";
import { propertyList } from "@/api/property";
import router from "@/router";
import * as store from "@/pinia/index";
const title = ref(import.meta.env.VITE_APP_TITLE).value;
let asyncData = reactive({
  organizationLogo: "",
  organizationName: "",
});
propertyList()
  .then((res) => {
    console.log(res);
  })
  .catch((error) => {
    console.log(error);
  });
onMounted(() => {
  asyncData.organizationLogo = store.family.loginStore().organizationLogo;
  asyncData.organizationName = store.family.loginStore().organizationName;
});
</script>

<template>
  <div class="dashboard-container">
    <img
      :src="
        asyncData.organizationLogo
          ? asyncData.organizationLogo
          : '@/assets/logo.png'
      "
      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>