App.vue 773 B

123456789101112131415161718192021222324252627282930313233
  1. <script setup>
  2. import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
  3. import { store } from "@/store/index.js";
  4. onLaunch(() => {
  5. // 尝试去获取本地的 token 和用户信息,填充到 store 中
  6. let token = uni.getStorageSync("token");
  7. if (token) {
  8. let userInfo = uni.getStorageSync("userInfo");
  9. if (userInfo) {
  10. if (userInfo.userId) {
  11. store.setUserInfo(userInfo);
  12. }
  13. }
  14. }
  15. // #ifdef APP-PLUS
  16. // initBarcodeModule();
  17. // #endif
  18. });
  19. </script>
  20. <style lang="scss">
  21. @import "@/uni_modules/uview-plus/index.scss";
  22. @import "@/static/css/mystyle.css";
  23. @import "@/static/css/common.scss";
  24. /*每个页面公共css */
  25. page {
  26. background: #f5f6fa;
  27. height: 100%;
  28. }
  29. </style>