App.vue 953 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <script>
  2. export default {
  3. onLaunch: function() {
  4. //解除跳转时闪过的登录页
  5. let userInfo = uni.getStorageSync('userInfo');
  6. let token = uni.getStorageSync('token');
  7. console.log(userInfo)
  8. if (!userInfo || !token) {
  9. uni.reLaunch({
  10. url: "/pages/login/index",
  11. success: () => {
  12. //跳转完页面后再关闭启动页
  13. // #ifdef APP-PLUS
  14. plus.navigator.closeSplashscreen();
  15. // #endif
  16. }
  17. })
  18. } else {
  19. // #ifdef APP-PLUS
  20. plus.navigator.closeSplashscreen();
  21. // #endif
  22. }
  23. },
  24. onShow: function() {
  25. console.log('App Show')
  26. },
  27. onHide: function() {
  28. console.log('App Hide')
  29. }
  30. }
  31. </script>
  32. <style>
  33. /*每个页面公共css */
  34. .uni-tabbar-bottom .uni-tabbar {
  35. /* border-radius: 19998rpx;
  36. box-shadow: 0rpx -6rpx 16rpx 0rpx rgba(47, 126, 243, 0.2);
  37. bottom: 20rpx;
  38. margin: 0 20rpx; */
  39. }
  40. .user-custom-btn {
  41. background: #DCE8F9;
  42. color: #2D74E7;
  43. }
  44. </style>