App.vue 447 B

12345678910111213141516171819202122232425
  1. <script>
  2. import { isLoggedIn } from '@/utils/auth'
  3. export default {
  4. onLaunch: function() {
  5. console.log('App Launch')
  6. // 已登录用户直接跳转首页,无需再进登录页
  7. if (isLoggedIn()) {
  8. uni.switchTab({
  9. url: '/pages/home/index'
  10. })
  11. }
  12. },
  13. onShow: function() {
  14. console.log('App Show')
  15. },
  16. onHide: function() {
  17. console.log('App Hide')
  18. }
  19. }
  20. </script>
  21. <style>
  22. /*每个页面公共css */
  23. </style>