App.vue 1.0 KB

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