App.vue 732 B

1234567891011121314151617181920212223242526272829303132
  1. <script>
  2. import { isLoggedIn } from '@/utils/auth'
  3. import { startGpsTimer } from '@/utils/gps'
  4. export default {
  5. onLaunch: function() {
  6. console.log('App Launch')
  7. // 退出或重新打开应用时,清除招募认证流程的暂存数据
  8. uni.removeStorageSync('recruit_form_data');
  9. uni.removeStorageSync('recruit_auth_data');
  10. uni.removeStorageSync('recruit_qual_data');
  11. // 已登录用户直接跳转首页,无需再进登录页
  12. if (isLoggedIn()) {
  13. startGpsTimer()
  14. uni.reLaunch({
  15. url: '/pages/home/index'
  16. })
  17. }
  18. },
  19. onShow: function() {
  20. console.log('App Show')
  21. },
  22. onHide: function() {
  23. console.log('App Hide')
  24. }
  25. }
  26. </script>
  27. <style>
  28. /*每个页面公共css */
  29. </style>