1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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://api.xayunmei.com/zhongcaiapi',
  13. requestUrl: 'http://121.40.189.20:9001',
  14. },
  15. onLaunch: function() {
  16. this.initApp();
  17. initEid();
  18. uni.setStorageSync('certificationStatus', '未认证')
  19. },
  20. methods: {
  21. // 初始化应用
  22. initApp() {
  23. // 初始化应用配置
  24. this.initConfig()
  25. // 检查用户登录状态
  26. //#ifdef H5
  27. this.checkLogin()
  28. //#endif
  29. },
  30. initConfig() {
  31. this.globalData.config = config
  32. },
  33. checkLogin() {
  34. if (!getToken()) {
  35. this.$tab.reLaunch('/pages/switchSystem')
  36. }
  37. }
  38. }
  39. }
  40. </script>
  41. <style lang="scss">
  42. @import '@/static/scss/index.scss'
  43. </style>