App.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <script>
  2. import {
  3. onBackPress
  4. } from "@dcloudio/uni-app"
  5. import cacheManager from "@/utils/cacheManager.js";
  6. export default {
  7. // creat by wgy 0619 生命周期 钩子
  8. onLaunch: function() {
  9. // #ifdef APP-PLUS
  10. if (cacheManager.get('auth')) {
  11. uni.reLaunch({
  12. url: `/pages/Login/index`,
  13. success() {
  14. plus.navigator.closeSplashscreen();
  15. }
  16. })
  17. } else {
  18. cacheManager.clearAll()
  19. uni.reLaunch({
  20. url: '/pages/Login/index' ,
  21. success() {
  22. plus.navigator.closeSplashscreen();
  23. }
  24. });
  25. }
  26. // #endif
  27. },
  28. onShow: function() {
  29. // #ifdef APP-PLUS
  30. const webview = plus.webview.currentWebview();
  31. plus.key.addEventListener('backbutton', () => {
  32. event.preventDefault();
  33. return false
  34. });
  35. // #endif
  36. },
  37. onHide: function() {
  38. }
  39. }
  40. </script>
  41. <style lang="scss">
  42. /* 公共样式 */
  43. @import '/common/styles/index.scss';
  44. // 西文、雅黑、黑体、宋体
  45. body,html,#app {
  46. font-family: "Helvetica Neue", "Microsoft YaHei", "SimHei", "SimSun", "Arial", sans-serif;
  47. margin: 0;
  48. padding: 0;
  49. box-sizing: border-box;
  50. }
  51. </style>