From 6ca18e0d2691d864e9796a64b58bb04bf44af99c Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期一, 13 五月 2024 09:44:43 +0800
Subject: [PATCH] Merge branch 'phyzasrs' of http://47.97.1.152:5880/r/wms_app into phyzasrs
---
main.js | 42 +++++++++++++++++++++++++++++++++++++++---
1 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/main.js b/main.js
index 5013c55..e40b387 100644
--- a/main.js
+++ b/main.js
@@ -2,12 +2,48 @@
// #ifndef VUE3
import Vue from 'vue'
-// Vue.prototype.baseUrl = "http://localhost:8081/acs"
-Vue.prototype.baseUrl = "http://localhost:8082/xgmwms"
Vue.config.productionTip = false
+
+import '@/common/bluetooth.js';
+//鍏ㄥ眬鏁版嵁鐘舵�佺鐞� vuex
+import store from '@/store/index.js';
+Vue.prototype.$store = store;
+//鍏ㄥ眬鍏敤闈欐�佹暟鎹�
+import Mock from '@/common/mock/index.js';
+Vue.prototype.$Mock = Mock;
+
App.mpType = 'app'
+
+try {
+ function isPromise(obj) {
+ return (
+ !!obj &&
+ (typeof obj === "object" || typeof obj === "function") &&
+ typeof obj.then === "function"
+ );
+ }
+
+ // 缁熶竴 vue2 API Promise 鍖栬繑鍥炴牸寮忎笌 vue3 淇濇寔涓�鑷�
+ uni.addInterceptor({
+ returnValue(res) {
+ if (!isPromise(res)) {
+ return res;
+ }
+ return new Promise((resolve, reject) => {
+ res.then((res) => {
+ if (res[0]) {
+ reject(res[0]);
+ } else {
+ resolve(res[1]);
+ }
+ });
+ });
+ },
+ });
+} catch (error) { }
+
const app = new Vue({
- ...App
+ ...App
})
app.$mount()
// #endif
--
Gitblit v1.9.1