<!--
 * @Description: 服务器授权提示组件
 * @Author: panqb
 * @Date: 2025-5-6 10:57:48
-->
<template>
  <div class="server-license" :style="componentStyle" v-if="serverLicenseData.msg">提示：{{ serverLicenseData.msg }}</div>
</template>

<script>
export default {
  name: 'YdLicense',
  props: {
    componentStyle: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {
        serverLicenseData: {},
    }
  },

  methods: {
    //判断服务器是否授权
    getServerLicense() {
      this.vueRequest({method: "GET", url: this.commonUrl.URL_VALIDATE_TJYD_LICENSE}).then(result => {
        if (result != null) {
          this.serverLicenseData = result.data;
          this.$emit('license-valid', result.data.valid);
        }
      })
    },
  },
  
  mounted() {
    this.getServerLicense();
  }
}
</script>
<style scoped lang="scss">
.server-license {
  margin: 5px 0 0 20px; 
  color: red; 
  font-size: 13px;
}
</style>