index.vue 567 B

1234567891011121314151617181920212223242526272829
  1. <template>
  2. <button>检查登录状态中……</button>
  3. </template>
  4. <script>
  5. export default {
  6. onLoad() {
  7. this.checkLogin()
  8. },
  9. methods: {
  10. async checkLogin() {
  11. // uni.showToast({
  12. // title: 'test',
  13. // mask: false,
  14. // duration: 1500
  15. // });
  16. const res = await this.$post('/api/admin/index/check_login')
  17. if(!res) return
  18. if (res.status) uni.redirectTo({
  19. url: `/module/main/index`
  20. })
  21. }
  22. }
  23. }
  24. </script>
  25. <style>
  26. </style>