App.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <script>
  2. // import routingIntercept from '@/common/permission.js'
  3. import {
  4. getToken
  5. } from '@/common/auth.js'
  6. export default {
  7. onLaunch(e) {
  8. // 限制必须在微信中打开H5连接,即公众号中打开
  9. // var ua = navigator.userAgent.toLowerCase();
  10. // var isWeixin = ua.indexOf('micromessenger') != -1;
  11. // if (!isWeixin) {
  12. // window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=888"
  13. // }
  14. const { path } = e
  15. if (!getToken()) {
  16. // 非老人自主注册页面, 不允许直接进入
  17. if (path !== 'pages/createInfo/createInfo') {
  18. uni.reLaunch({
  19. url: '/pages/login/index'
  20. })
  21. }
  22. }
  23. },
  24. onShow: function() {},
  25. onHide: function() {}
  26. }
  27. </script>
  28. <style>
  29. /*每个页面公共css */
  30. @font-face {
  31. /* font-family: 'puhui';
  32. src: url('./static/fonts/AlibabaPuHuiTi-3-65-Medium.ttf'); */
  33. }
  34. .global-font {
  35. /* font-family: 'puhui';
  36. font-size: 16px;
  37. color: #333; */
  38. }
  39. uni-page-body,
  40. html,
  41. body {
  42. height: 100%;
  43. }
  44. </style>