index.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <footer v-if="theme.showFooter" class="vab-footer">
  3. Copyright
  4. <vab-icon icon="copyright-line" />
  5. {{ fullYear }} {{ title }}
  6. <a
  7. v-if="beian"
  8. class="hidden-xs-only"
  9. href="https://beian.miit.gov.cn/#/Integrated/index"
  10. style="margin-left: 3px; color: var(--el-color-grey)"
  11. target="_blank"
  12. >
  13. {{ beian }}
  14. </a>
  15. </footer>
  16. </template>
  17. <script lang="ts" setup>
  18. import { useSettingsStore } from '/@/store/modules/settings'
  19. defineOptions({
  20. name: 'VabFooter',
  21. })
  22. const route = useRoute()
  23. const fullYear = new Date().getFullYear()
  24. const settingsStore = useSettingsStore()
  25. const { title, theme } = storeToRefs(settingsStore)
  26. const beian = ref<any>(localStorage.getItem('beian'))
  27. onBeforeMount(() => {
  28. if (route.query && route.query.beian) {
  29. beian.value = route.query.beian
  30. localStorage.setItem('beian', beian.value)
  31. } else {
  32. // 应对工信部审查,请自行配置成自己的备案号
  33. // 以下网站一年内停用
  34. if (location.hostname.includes('beautiful')) beian.value = ''
  35. // 以下网站为此后官方站点
  36. if (location.hostname.includes('vuejs-core')) beian.value = ''
  37. }
  38. })
  39. </script>
  40. <style lang="scss" scoped>
  41. .vab-footer {
  42. display: flex;
  43. align-items: center;
  44. justify-content: center;
  45. min-height: var(--el-footer-height);
  46. padding: 0 var(--el-padding) 0 var(--el-padding);
  47. margin-top: var(--el-margin);
  48. color: var(--el-color-grey);
  49. background: var(--el-color-white);
  50. border: 1px solid var(--el-border-color);
  51. border-radius: var(--el-border-radius-base);
  52. transition: var(--el-transition);
  53. i {
  54. margin: 0 3px;
  55. }
  56. }
  57. </style>