App.vue 512 B

123456789101112131415161718192021222324252627
  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. if (isLoggedIn()) {
  9. startGpsTimer()
  10. uni.switchTab({
  11. url: '/pages/home/index'
  12. })
  13. }
  14. },
  15. onShow: function() {
  16. console.log('App Show')
  17. },
  18. onHide: function() {
  19. console.log('App Hide')
  20. }
  21. }
  22. </script>
  23. <style>
  24. /*每个页面公共css */
  25. </style>