12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <script>
  2. import config from './config'
  3. import store from '@/store'
  4. import {
  5. getToken
  6. } from '@/utils/auth'
  7. import {
  8. initEid
  9. } from './mp_ecard_sdk/main';
  10. export default {
  11. globalData: {
  12. requestUrl: 'https://www.api.xayunmei.com/API',
  13. },
  14. onLaunch: function() {
  15. this.initApp();
  16. initEid();
  17. uni.setStorageSync('certificationStatus', '未认证')
  18. },
  19. methods: {
  20. // 初始化应用
  21. initApp() {
  22. // 初始化应用配置
  23. this.initConfig()
  24. // 检查用户登录状态
  25. //#ifdef H5
  26. this.checkLogin()
  27. //#endif
  28. },
  29. initConfig() {
  30. this.globalData.config = config
  31. },
  32. checkLogin() {
  33. if (!getToken()) {
  34. this.$tab.reLaunch('/pages/login')
  35. }
  36. }
  37. }
  38. }
  39. </script>
  40. <style lang="scss">
  41. @import '@/static/scss/index.scss'
  42. </style>