综合办公系统
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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. uni.addInterceptor("reLaunch", {
  11. invoke(e) {
  12. // 因为刷新后进行后退会调用这个路径,所以需要劫持然后调用back方法。
  13. if (e.url == "/") {
  14. history.back();
  15. return false;
  16. }
  17. },
  18. });
  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/login')
  36. }
  37. }
  38. }
  39. }
  40. </script>
  41. <style lang="scss">
  42. @import '@/static/scss/index.scss'
  43. </style>