租房小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
914 B

3 months ago
2 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
  1. import App from './App'
  2. import uvUI from '@/uni_modules/uv-ui-tools' import { Request } from '@/util/request/index'
  3. import Vue from 'vue'
  4. Vue.config.productionTip = false
  5. console.info('config')
  6. import './config.js' import './utils/index.js'
  7. App.mpType = 'app'
  8. try {
  9. function isPromise(obj) {
  10. return (!!obj && (typeof obj === "object" || typeof obj === "function") && typeof obj.then === "function");
  11. }
  12. // 统一 vue2 API Promise 化返回格式与 vue3 保持一致
  13. uni.addInterceptor({
  14. returnValue(res) {
  15. if (!isPromise(res)) {
  16. return res;
  17. }
  18. return new Promise((resolve, reject) => {
  19. res.then((res) => {
  20. if (res[0]) {
  21. reject(res[0]);
  22. } else {
  23. resolve(res[1]);
  24. }
  25. });
  26. });
  27. },
  28. });
  29. } catch (error) {}
  30. import store from '@/store' Vue.prototype.$store = store
  31. const app = new Vue({
  32. ...App,
  33. store
  34. })
  35. app.$mount()
  36. Request(app)