App.vue 840 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <style lang="scss">
  2. /* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
  3. @import "@/uni_modules/uview-ui/index.scss";
  4. </style>
  5. <script>
  6. import config from './config'
  7. import store from '@/store'
  8. import { getToken } from '@/utils/auth'
  9. export default {
  10. onLaunch: function() {
  11. this.initApp()
  12. },
  13. methods: {
  14. // 初始化应用
  15. initApp() {
  16. // 初始化应用配置
  17. this.initConfig()
  18. // 检查用户登录状态
  19. //#ifdef H5
  20. this.checkLogin()
  21. //#endif
  22. },
  23. initConfig() {
  24. this.globalData.config = config
  25. },
  26. checkLogin() {
  27. // if (!getToken()) {
  28. // this.$tab.reLaunch('/pages/login')
  29. // }
  30. }
  31. }
  32. }
  33. </script>
  34. <style lang="scss">
  35. @import '@/static/scss/index.scss'
  36. </style>