cloudroam
2025-03-28 cef2bb0eeeb91a22860cf5d23c7348af1ba921dc
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<template>
  <div class="back-layout">
    <div v-if="isMobile && !menuShrink" class="back-layout__backdrop" @click="onBackdropClick" />
    <base-sidebar></base-sidebar>
    <div class="back-layout__right">
      <base-nav></base-nav>
      <tags-view v-if="enableTagView"></tags-view>
      <div class="back-layout__main">
        <nuxt />
      </div>
      <div class="copyright">
        <img class="copyright-logo" :src="logoUrl" /> {{ copyright?.base_website_name }} 版权所有 |
        {{ copyright?.base_regisition_num }}
      </div>
    </div>
  </div>
</template>
 
<script>
import { mapState } from 'vuex'
import TagsView from '@/components/tags-view'
export default {
  components: {
    TagsView,
  },
  middleware: ['auth', 'permission'],
  created() {
    this.getCopyRight()
  },
  data() {
    return {
      enableTagView: this.$config.enableTagView,
      copyright: {},
      logoUrl: '',
    }
  },
  computed: {
    ...mapState({
      isMobile: (state) => state.app.isMobile,
      menuShrink: (state) => state.app.menuShrink,
    }),
  },
  methods: {
    onBackdropClick() {
      this.$store.commit('app/SET_MENU_SHRINK', true)
    },
 
    async getCopyRight() {
      const { code, data } = await this.$services.base.getBaseInfo()
      if (code === 0) {
        this.copyright = data
        this.copyright.base_bg_url = JSON.parse(data.base_bg_url || [])
        this.copyright.base_logo_url = JSON.parse(data.base_logo_url || [])
        this.logoUrl = this.copyright?.base_logo_url[0]?.url
      }
    },
  },
}
</script>
 
<style scoped lang="scss">
.back-layout {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
 
  &__backdrop {
    background-color: rgba(0, 0, 0, 0.3);
    width: 100%;
    top: 0;
    height: 100%;
    position: absolute;
    z-index: 999;
  }
 
  &__right {
    flex: 1;
    height: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
  }
 
  &__main {
    flex: 1;
    background-color: $bg-color;
    overflow: auto;
    padding: 20px;
  }
 
  .copyright {
    margin: auto;
    margin-top: 10px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-content: center;
    font-size: 12px;
    color: gray;
 
    .copyright-logo {
      width: 15px;
      height: 15px;
      border-radius: 50px;
      /* 设置圆角 */
    }
  }
}
</style>