移动储能车V1版本
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import App from './App'
  2. import Store from './store'
  3. // #ifndef VUE3
  4. import Vue from 'vue'
  5. import './uni.promisify.adaptor'
  6. Vue.config.productionTip = false
  7. App.mpType = 'app'
  8. const app = new Vue({
  9. ...App
  10. })
  11. app.$mount()
  12. // #endif
  13. // #ifdef VUE3
  14. import { createSSRApp } from 'vue'
  15. export function createApp() {
  16. const app = createSSRApp(App)
  17. app.use(Store) //新增的一行
  18. return {
  19. app
  20. }
  21. }
  22. // #endif
  23. import { $http } from './api/http.js'
  24. // import { login } from './api/api'
  25. uni.$http = $http
  26. $http.baseUrl = ''
  27. // uni.$apiKey = 'xxxxxxxxx'
  28. // 请求开始之前
  29. $http.beforeRequest = function (options) {
  30. // uni.showLoading({
  31. // title: '数据加载中...',
  32. // })
  33. // if(options.url!="http://10.168.4.100:80/api/v1/login"){
  34. // console.log(options);
  35. // if (!uni.getStorageSync('token')) {
  36. // login().then(data => {
  37. // // console.log(data);
  38. // if (data.status == 'ok') {
  39. // uni.setStorage({
  40. // key: 'token',
  41. // data: data.data.token,
  42. // success: function(res) {
  43. // console.log(res);
  44. // }
  45. // });
  46. // }else{
  47. // uni.showToast({
  48. // title:data.msg,
  49. // icon: 'none',
  50. // duration: 2000, // 显示时长,单位为毫秒
  51. // });
  52. // }
  53. // });
  54. // }
  55. // }
  56. }
  57. // 请求完成之后
  58. $http.afterRequest = function () {
  59. // uni.hideLoading()
  60. }