Home.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <div class="home">
  3. <a-alert message="欢迎登录智享亿家运营系统" type="info" showIcon />
  4. <!-- 重置密码 -->
  5. <a-modal
  6. class="resetPwdModal"
  7. title="重置密码"
  8. width="60%"
  9. centered
  10. :footer="null"
  11. :closable="false"
  12. :maskClosable="false"
  13. :destroyOnClose="true"
  14. @cancel="openResetPwd=false"
  15. v-model="openResetPwd">
  16. <ResetPwd />
  17. </a-modal>
  18. </div>
  19. </template>
  20. <script>
  21. import { mapGetters } from 'vuex'
  22. import ResetPwd from '@/views/user/ResetPwd.vue'
  23. export default {
  24. name: 'Home',
  25. components: { ResetPwd },
  26. data () {
  27. return {
  28. openResetPwd: false // 重置密码是否显示
  29. }
  30. },
  31. computed: {
  32. ...mapGetters(['mustChangePwd'])
  33. },
  34. created () {
  35. },
  36. methods: {
  37. },
  38. beforeRouteEnter (to, from, next) {
  39. next(vm => {
  40. // 判断登录用户是否重置过密码(首次登陆需强制重置密码)
  41. if (vm.mustChangePwd == 0) {
  42. vm.openResetPwd = false
  43. } else {
  44. vm.openResetPwd = true
  45. }
  46. console.log(vm.mustChangePwd, '-------是否需要重置密码')
  47. })
  48. },
  49. }
  50. </script>
  51. <style scoped>
  52. .home {
  53. /* width: 900px;
  54. margin: 0 auto;
  55. padding: 25px 0; */
  56. }
  57. </style>