| | |
| | | </template> |
| | | |
| | | <script> |
| | | import * as api from "@/axios/api"; |
| | | |
| | | export default { |
| | | name: "dialogVisible", |
| | | data() { |
| | |
| | | }, |
| | | mounted() { |
| | | if (!this.routeShowPathArr.includes(this.$route.path)) { // 查找不弹出的path |
| | | setTimeout(() => { |
| | | this.dialogVisible = true; |
| | | }, 1000); |
| | | this.getUserInfo(); |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | goToReg() { |
| | | this.dialogVisible = false; |
| | | this.$router.push('/register'); |
| | | }, |
| | | async getUserInfo() { |
| | | // 获取用户信息 |
| | | let data = await api.getUserInfo(); |
| | | if (data.status === 0) { |
| | | // 判断是否登录 |
| | | this.dialogVisible = false; |
| | | } else { |
| | | setTimeout(() => { |
| | | this.dialogVisible = true; |
| | | }, 1000); |
| | | } |
| | | }, |
| | | } |
| | | }; |
| | | </script> |