App.vue 839 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <script>
  2. // import routingIntercept from '@/common/permission.js'
  3. import {
  4. getToken
  5. } from '@/common/auth.js'
  6. export default {
  7. onLaunch: function() {
  8. if (getToken()) {
  9. console.log('存在');
  10. uni.reLaunch({
  11. url: '/pages/index/index'
  12. })
  13. } else {
  14. console.log('不存在');
  15. uni.reLaunch({
  16. url: '/pages/login/index'
  17. })
  18. }
  19. // routingIntercept()
  20. console.log('App Launch')
  21. },
  22. onShow: function() {
  23. console.log('App Show')
  24. },
  25. onHide: function() {
  26. console.log('App Hide')
  27. }
  28. }
  29. </script>
  30. <style>
  31. /*每个页面公共css */
  32. @font-face {
  33. /* font-family: 'puhui';
  34. src: url('./static/fonts/AlibabaPuHuiTi-3-65-Medium.ttf'); */
  35. }
  36. .global-font {
  37. /* font-family: 'puhui';
  38. font-size: 16px;
  39. color: #333; */
  40. }
  41. uni-page-body,
  42. html,
  43. body {
  44. height: 100%;
  45. }
  46. </style>