App.vue 939 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. url: "/pages/homePage/index",
  14. success: () => {
  15. // #ifdef APP-PLUS
  16. plus.navigator.closeSplashscreen();
  17. // #endif
  18. }
  19. })
  20. // #endif
  21. } else {
  22. uni.reLaunch({
  23. url: "/pages/login/index",
  24. success: () => {
  25. // #ifdef APP-PLUS
  26. plus.navigator.closeSplashscreen();
  27. // #endif
  28. }
  29. })
  30. }
  31. },
  32. onShow: function() {
  33. console.log('App Show')
  34. },
  35. onHide: function() {
  36. console.log('App Hide')
  37. }
  38. }
  39. </script>
  40. <style>
  41. /*每个页面公共css */
  42. @import '@/uni_modules/uview-ui/theme.scss';
  43. uni-button:after {
  44. border: none;
  45. }
  46. uni-page-head .uni-page-head__title{
  47. font-size: 18px !important;
  48. }
  49. </style>