e89f8030d007ea712ad40e33a6afdb5c051866e7.svn-base 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <div>
  3. <a-form style="margin: 40px auto 0;">
  4. <result title="更改密码成功" :is-success="true">
  5. <div class="toLogin">
  6. <h3>将在<span>{{time}}</span>秒后返回登录页面.</h3>
  7. </div>
  8. </result>
  9. </a-form>
  10. </div>
  11. </template>
  12. <script>
  13. import Result from '@/views/result/Result'
  14. export default {
  15. name: "Step4",
  16. props:['userList'],
  17. components: {
  18. Result
  19. },
  20. data () {
  21. return {
  22. loading: false,
  23. time: 0,
  24. }
  25. },
  26. methods: {
  27. countDown(){
  28. let that = this;
  29. that.time--;
  30. }
  31. },
  32. mounted(){
  33. let that = this;
  34. that.time = 5;
  35. setInterval(that.countDown, 1000);
  36. },
  37. watch: {
  38. time: function (newVal,oldVal) {
  39. if (newVal == 0) {
  40. var params = {
  41. username: this.userList.username
  42. };
  43. this.$router.push({name: 'login', params})
  44. }
  45. }
  46. }
  47. }
  48. </script>
  49. <style scoped>
  50. .toLogin{
  51. text-align: center;
  52. }
  53. </style>