<template functional>
  <div class="copyright">
    <p class="copyright-logo" v-if="props.logo">
      <img src="../assets/logo-foot.png" alt="logo" />
    </p>
    <p>版权所有©{{ props.base.copyrightYear }} {{ props.base.copyright }}</p>
    <p>
      <a href="http://beian.miit.gov.cn/" target="_blank">{{ props.base.icp }}</a>
    </p>
  </div>
</template>

<script>
import settings from "@/api/settings";
export default {
  name: "Copyright",
  props: {
    logo: {
      type: Boolean,
      default: false
    },
    base: {
      type: Object,
      default() {
        return {
          ...settings,
          copyrightYear: new Date().getFullYear()
        };
      }
    }
  }
};
</script>

<style lang="less" scoped>
@import "../style/var.less";
.copyright {
  margin: 16px 0;
  text-align: center;
  color: @gray-4;
  font-size: @font-size-12;
  line-height: @line-height-sm + 2;
  a {
    color: @gray-4;
  }
  &-logo {
    text-align: center;
    margin-bottom: 10px;
    img {
      width: 121px;
      height: 66px;
    }
  }
}
</style>
