App.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. </script>
  25. <style lang="scss">
  26. /*每个页面公共css */
  27. @import '@/common/style.scss';
  28. /* uView基础样式 */
  29. @import 'uview-ui/index.scss';
  30. @import '@/common/animate.min.css';
  31. //全局页面背景色
  32. page {
  33. background-color: white;
  34. }
  35. //底部安全距离
  36. .bottom-safety {
  37. padding-bottom: constant(safe-area-inset-bottom);
  38. padding-bottom: env(safe-area-inset-bottom);
  39. }
  40. /**uniapp中uni.showModal H5中被挡住的解决方案*/
  41. uni-modal {
  42. z-index: 19999 !important;
  43. }
  44. /**去掉官方button边框线*/
  45. button::after {
  46. border: none;
  47. }
  48. /**挂载iconfont字体图标*/
  49. @font-face {
  50. font-family: 'iconfont';
  51. src: url('https://at.alicdn.com/t/c/font_4191999_iwlclbsmm7.ttf?t=1691268694703') format('truetype');
  52. /* src: url('~@/static/font/iconfont.ttf') format('truetype'); */
  53. }
  54. .icon {
  55. font-family: iconfont;
  56. }
  57. </style>