<template>
  <div>
    <el-empty :description="hasPermission ? message :`您没有访问权限,请联系管理员`" image="/static/warning.png">
      <template slot="description">
        <div v-if="message !== '未获取到用户数据'">
          <p style="font-size:16px">未通过公众号授权</p>
          <p style="font-size:16px">请联系系统管理员</p>
        </div>
        <div v-else>
          <p style="font-size:16px">登录已失效</p>
          <p style="font-size:16px">请返回数据导航重新进入</p>
        </div>
      </template>
      <div style="display: flex;gap: 10px;">
        <el-button size="mini" type="" @click="toNav">返回数据导航</el-button>
        <!-- <el-button size="mini" type="primary" @click="toLogin">重新登录</el-button> -->
      </div>
    </el-empty>
  </div>
</template>

<script>
export default {
  name:'UnusualState',
  props:['message', 'path', 'hasPermission'],
  methods:{
    toNav(){
      // this.$router.push('/')
      window.location.href = "/"
    },
    toLogin(){
      this.$router.push('/login' + (this.path ? `?path=${this.path}` : ''))
    }
  }
}
</script>
