App.vue 854 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <script>
  2. import {
  3. getToken
  4. } from './utils/auth.js'
  5. export default {
  6. onLaunch: function() {
  7. console.log('App Launch')
  8. const token = getToken()
  9. if (token) {
  10. // #ifdef APP-PLUS
  11. uni.reLaunch({
  12. url: "/pages/reportForm/index",
  13. success: () => {
  14. // #ifdef APP-PLUS
  15. plus.navigator.closeSplashscreen();
  16. // #endif
  17. }
  18. })
  19. // #endif
  20. } else {
  21. // uni.reLaunch({
  22. // url: "/pages/login/index",
  23. // success: () => {
  24. // // #ifdef APP-PLUS
  25. // plus.navigator.closeSplashscreen();
  26. // // #endif
  27. // }
  28. // })
  29. }
  30. },
  31. onShow: function() {
  32. console.log('App Show')
  33. },
  34. onHide: function() {
  35. console.log('App Hide')
  36. }
  37. }
  38. </script>
  39. <style>
  40. /*每个页面公共css */
  41. @import '@/uni_modules/uview-ui/theme.scss';
  42. uni-button:after {
  43. border: none;
  44. }
  45. </style>