Home.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <div class="home">
  3. <a-alert :message="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. message: '欢迎登录' + process.env.VUE_APP_PRO_NAME,
  29. openResetPwd: false // 重置密码是否显示
  30. }
  31. },
  32. computed: {
  33. ...mapGetters(['mustChangePwd'])
  34. },
  35. created () {
  36. },
  37. methods: {
  38. },
  39. beforeRouteEnter (to, from, next) {
  40. next(vm => {
  41. // 判断登录用户是否重置过密码(首次登陆需强制重置密码)
  42. if (vm.mustChangePwd == 0) {
  43. vm.openResetPwd = false
  44. } else {
  45. vm.openResetPwd = true
  46. }
  47. })
  48. }
  49. }
  50. </script>
  51. <style scoped>
  52. .home {
  53. /* width: 900px;
  54. margin: 0 auto;
  55. padding: 25px 0; */
  56. }
  57. </style>