App.vue 1018 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <script>
  2. export default {
  3. onLaunch: function() {
  4. //#ifdef APP-PLUS
  5. //获取已保存在本地的用户信息,该内容在登录页面登录成功之后,才保存到本地的
  6. const userInfo = uni.getStorageSync('token');
  7. if (userInfo) {
  8. uni.reLaunch({
  9. url: "/pages/index/index",
  10. })
  11. } else {
  12. uni.navigateTo({
  13. url: '/pages/login/login'
  14. });
  15. }
  16. //#endif
  17. },
  18. onShow: function() {
  19. //this.getAuth();
  20. },
  21. onHide: function() {},
  22. methods: {
  23. }
  24. }
  25. </script>
  26. <style lang="scss">
  27. /*每个页面公共css */
  28. /* uView基础样式 */
  29. @import "uview-ui/index.scss";
  30. //全局页面背景色
  31. page{
  32. background-color: #e2e2e2;
  33. font-family: '宋体';
  34. }
  35. // 点击时背景灰色
  36. // .hover-class{
  37. // background-color: #f7f7f7!important;
  38. // }
  39. //底部安全距离
  40. .bottom-safety {
  41. padding-bottom: constant(safe-area-inset-bottom);
  42. padding-bottom: env(safe-area-inset-bottom);
  43. }
  44. //全局白色背景
  45. .bgc-f {
  46. background-color: #ffffff;
  47. }
  48. </style>