zhengyiming
16 小时以前 a48be50fb38f21c6dd7ac8545c80d511783449ab
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
54
55
56
57
58
59
60
61
62
63
64
<!--
 * @Author: 秦少卫
 * @Date: 2024-06-11 09:12:24
 * @LastEditors: 秦少卫
 * @LastEditTime: 2024-06-12 09:02:50
 * @Description: logo
-->
 
<template>
  <div class="logo">
    <a :href="webInfo.url" target="_blank">
      <img :src="webInfo.img" alt="webInfo.name" />
    </a>
  </div>
</template>
 
<script setup name="Logo">
import { getWebInfo } from '@/api/material';
import { get, pick } from 'lodash-es';
const baseURL = import.meta.env.APP_APIHOST;
 
const webInfo = ref({
  name: '',
  logo: '',
  url: '',
});
 
const getWebInfoFun = async () => {
  const res = await getWebInfo();
  const info = pick(res.data.data.attributes, ['name', 'url']);
  info.img = baseURL + get(res.data, 'data.attributes.logo.data.attributes.url');
  webInfo.value = info;
};
 
getWebInfoFun();
</script>
<style scoped lang="less">
.logo {
  width: 117px;
  height: 44px;
  display: inline-block;
  margin-right: 10px;
  margin-left: 2px;
  a {
    display: flex;
    height: 100%;
    align-items: center;
    img {
      display: inline-block;
      height: 80%;
    }
    span {
      font-size: 18px;
      font-weight: bold;
      margin-left: 6px;
    }
  }
  // text-align: center;
  // vertical-align: middle;
  // .ivu-icon {
  //   vertical-align: super;
  // }
}
</style>