租房小程序前端代码
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.

50 lines
974 B

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