You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
651 B

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