“dzb”
2022-09-27 80e0b9da4d4da98452f8930b148750763d85f090
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
65
66
67
68
69
70
71
<template>
  <div id="app">
    <router-view />
  </div>
</template>
<script>
 
export default {
  data() {
    return {
      mytitle: '',
    }
  },
  async created() {
    const imgObj = await this.getIcon();
    this.changIcon(imgObj);
  },
  methods: {
    changIcon(obj) {
      var link = document.querySelector("link [rel*='icon']") || document.createElement("link");
      var title = document.querySelector("title") || document.createElement("title");
      link.type = "image/x-icon";
      link.rel = "shortcut icon";
      link.href = obj.chromeLinkUrl;  //icon图标
      title.innerHTML = obj.title;
      document.getElementsByTagName("head")[0].appendChild(link);
      document.getElementsByTagName("head")[0].appendChild(title);
    },
    // 获取icon
    async getIcon() {
      let result;
      const pic = JSON.parse(sessionStorage.getItem('pic'));
      if (pic) {
        result = pic;
        // console.log('缓存')
      } else {
        // console.log('请求');
        await this.$axios({
          method: 'get',
          url: 'sccg/system/portal/logo/search',
        }).then(res => {
          result = res.data;
          sessionStorage.setItem('pic',JSON.stringify(result));
        })
      }
      return result;
    },
  }
};
</script>
<style>
  .el-select-dropdown__item{
  height: 100%;
}
.el-select-dropdown,.popper-class{
  background-color: #17324c;
}
.el-select-dropdown__item.hover, .el-select-dropdown__item:hover{
  background-color: #17324c;
}
.el-tree{
  background-color: #17324c;
}
.el-tree-node__content:hover, .el-upload-list__item:hover{
  background-color: #09152f;
  color: #4b9bb7;
}
.el-tree-node:focus>.el-tree-node__content{
  background-color: #09152f;
}
</style>