فهرست منبع

打包配置修改

fanghuisheng 2 سال پیش
والد
کامیت
1e16c7dcd5

+ 1 - 1
package.json

@@ -18,7 +18,7 @@
         "dev:quickapp-webview-union": "uni -p quickapp-webview-union",
         "build:app": "uni build -p app",
         "build:custom": "uni build -p",
-        "build:h5": "uni build",
+        "build:h5": "rimraf dist && uni build",
         "build:h5:ssr": "uni build --ssr",
         "build:mp-alipay": "uni build -p mp-alipay",
         "build:mp-baidu": "uni build -p mp-baidu",

+ 3 - 2
src/config.js

@@ -1,9 +1,10 @@
 // 应用全局配置
 export default {
   // baseUrl: 'https://vue.ruoyi.vip/prod-api',
-  // baseUrl: 'http://localhost:8080/prod-api',
-  baseUrl: "http://172.16.120.165:13200/prod-api",
+  baseUrl: import.meta.env.MODE=== "production" ? "http://mobile.usky.cn:8099/prod-api" : "http://172.16.120.165:13200/prod-api",
+  // baseUrl: "http://mobile.usky.cn:8099/prod-api",
   websiteUrl: "https://qhome.usky.cn",
+  // NODE_ENV=devlopment
   // 应用信息
   appInfo: {
     // 应用名称

+ 1 - 10
src/manifest.json

@@ -150,16 +150,7 @@
         },
         "devServer" : {
             "https" : false,
-            "proxy" : {
-                "/system" : {
-                    "target" : "http://172.16.120.165:13200/prod-api",
-                    "changeOrigin" : true,
-                    "secure" : false,
-                    "pathRewrite" : {
-                        "^/system" : "/system"
-                    }
-                }
-            }
+            "proxy" : {}
         },
         "sdkConfigs" : {
             "maps" : {

+ 1 - 1
src/pages/common/textview/index.vue

@@ -8,7 +8,7 @@
 
 <script setup>
 import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
-import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance } from "vue";
+import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance, toRefs } from "vue";
 
 const data = reactive({
   title: "",

+ 1 - 1
src/pages/common/webview/index.vue

@@ -6,7 +6,7 @@
 
 <script setup>
 import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
-import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance } from "vue";
+import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance, toRefs } from "vue";
 
 const props = defineProps({
   // 数据

+ 1 - 1
src/pages/mine/info/edit.vue

@@ -25,7 +25,7 @@ import { getUserProfile } from "@/api/system/user";
 import { updateUserProfile } from "@/api/system/user";
 
 import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
-import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance } from "vue";
+import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance, toRefs } from "vue";
 
 const data = reactive({
   user: {

+ 1 - 1
src/pages/setting/funReport/funcAdd/funcAdd.vue

@@ -91,7 +91,7 @@
 
 <script setup>
 import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
-import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance, watch } from "vue";
+import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance, watch, toRefs } from "vue";
 
 const data = reactive({
   id: "",

+ 20 - 0
vite.config.js

@@ -10,6 +10,26 @@ export default defineConfig(({ mode, command }) => {
       host: true, //指定服务器
       open: true, //自动打开浏览器
       port: 8080, //启动端口
+      proxy: {
+        "/dev-api": {
+          target: "http://172.16.120.165:13200",
+          ws: true,
+          changeOrigin: true,
+          pathRewrite: {
+            "^/api": "",
+          },
+          //rewrite: (p) => p.replace(/^\/dev-api/, '')
+        },
+        "/prod-api": {
+          target: "http://mobile.usky.cn:8099",
+          ws: true,
+          changeOrigin: true,
+          pathRewrite: {
+            "^/api": "",
+          },
+          //rewrite: (p) => p.replace(/^\/dev-api/, '')
+        },
+      },
     },
     plugins: [uni()],
     resolve: {