App.vue 774 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <script>
  2. export default {
  3. onLaunch: function() {
  4. // uni.reLaunch({
  5. // url: '/pages/home/index'
  6. // });
  7. // 判断是否有token 跳转对应的页面
  8. if (uni.getStorageSync('accessToken')) {
  9. uni.reLaunch({url: '/pages/home/index'})
  10. // this.$u.route('/pages/vehicleProtection/detailed');
  11. } else {
  12. uni.reLaunch({
  13. url: '/pages/login/index'
  14. });
  15. }
  16. },
  17. onShow: function() {
  18. },
  19. onHide: function() {
  20. }
  21. }
  22. </script>
  23. <style lang="scss">
  24. /*每个页面公共css */
  25. @import '@/uni_modules/uni-scss/index.scss';
  26. /* #ifndef APP-NVUE */
  27. @import '@/static/customicons.css';
  28. // 设置整个项目的背景色
  29. page {
  30. background-color: #F4F4F4;
  31. }
  32. /* #endif */
  33. .example-info {
  34. font-size: 14px;
  35. color: #333;
  36. padding: 10px;
  37. }
  38. </style>