<template>
  <div class="home">
    <a-alert message="欢迎登录智享亿家运营系统" type="info" showIcon />
    <!-- 重置密码 -->
    <a-modal
      class="resetPwdModal"
      title="重置密码"
      width="60%"
      centered
      :footer="null"
      :closable="false"
      :maskClosable="false"
      :destroyOnClose="true"
      @cancel="openResetPwd=false"
      v-model="openResetPwd">
      <ResetPwd />
    </a-modal>
 </div>
</template>

<script>
  import { mapGetters } from 'vuex'
  import ResetPwd from '@/views/user/ResetPwd.vue'
export default {
  name: 'Home',
  components: { ResetPwd },
  data () {
    return {
      openResetPwd: false //  重置密码是否显示
    }
  },
  computed: {
    ...mapGetters(['mustChangePwd'])
  },
  created () {
  },
  methods: { 
  },
  beforeRouteEnter (to, from, next) {
    next(vm => {
      //  判断登录用户是否重置过密码（首次登陆需强制重置密码）
      if (vm.mustChangePwd == 0) {
        vm.openResetPwd = false
      } else {
        vm.openResetPwd = true
      }
      console.log(vm.mustChangePwd, '-------是否需要重置密码')
    })
  },
}
</script>
<style scoped>
  .home {
    /* width: 900px;
    margin: 0 auto;
    padding: 25px 0; */
  }
</style>
