index.vue 436 B

123456789101112131415161718192021222324
  1. <template>
  2. <div id="nav">
  3. 检查登录状态中……
  4. </div>
  5. </template>
  6. <script>
  7. export default {
  8. mounted() {
  9. this.checkLogin()
  10. },
  11. methods: {
  12. async checkLogin() {
  13. console.log(this)
  14. const res = await this.$post('/api/admin/index/check_login')
  15. // console.log(res)
  16. if(res.status) this.$router.replace('/main')
  17. else this.$router.replace('/login')
  18. }
  19. }
  20. }
  21. </script>
  22. <style>
  23. </style>