App.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <script>
  2. import { ref, getCurrentInstance } from 'vue'
  3. export default {
  4. onLaunch: function () {
  5. /* if (process.env.NODE_ENV === 'development') {
  6. } else {
  7. const { $Http } = getCurrentInstance().proxy;
  8. if (uni.getStorageSync('userMsg').token) {
  9. $Http.basic({
  10. "classname": "webmanage.site.site",
  11. "method": "querySite_Parameter", //查询站点数据
  12. content: {
  13. nocache: true
  14. }
  15. }).then(res => {
  16. if (res.code == 1) {
  17. uni.removeStorageSync('siteP');
  18. uni.setStorageSync("siteP", res.data)
  19. try {
  20. let currentPages = getCurrentPages().pop();
  21. if (currentPages.route == 'pages/login/login' || currentPages.$page.fullPath == "/pages/login/login") uni.redirectTo({
  22. url: '/pages/index/index',
  23. });
  24. } catch (error) {
  25. uni.redirectTo({
  26. url: '/pages/index/index',
  27. });
  28. }
  29. }
  30. })
  31. }
  32. } */
  33. },
  34. onShow: function () {
  35. try {
  36. const { $Http } = getCurrentInstance().proxy;
  37. $Http.uploadNumber && $Http.uploadNumber();
  38. } catch (error) {
  39. }
  40. },
  41. onHide: function () {
  42. }
  43. }
  44. </script>
  45. <style lang="scss">
  46. /* 注意要写在第一行,注意不能引入至uni.scss,同时给style标签加入lang="scss"属性 */
  47. @import "@/uni_modules/uview-plus/index.scss";
  48. @import '/static/iconfont.css';
  49. page {
  50. background-color: #F7F7FF;
  51. }
  52. </style>