From a9b2a4de7d80c701b43b998aaa96967df2bb8d2a Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Thu, 26 Feb 2026 17:26:45 +0800
Subject: [PATCH] feat:https和http
---
applications/mobile-web-view/src/axios.js | 10 +++++-----
applications/mobile-web-view/vite.config.mjs | 17 +++++++++++++----
2 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/applications/mobile-web-view/src/axios.js b/applications/mobile-web-view/src/axios.js
index 6d74033..87997df 100644
--- a/applications/mobile-web-view/src/axios.js
+++ b/applications/mobile-web-view/src/axios.js
@@ -40,11 +40,11 @@
config => {
// 初始化错误提示状态
isErrorShown = false
- if (VITE_APP_ENV === 'development') {
- config.url = VITE_APP_API + config.url
- } else {
- config.url = VITE_APP_XT_URL + config.url
- }
+ // if (VITE_APP_ENV === 'development') {
+ // config.url = VITE_APP_API + config.url
+ // } else {
+ // config.url = VITE_APP_XT_URL + config.url
+ // }
config.headers['areaCode'] = store.state.user.selectedAreaCode
//安全请求header
config.headers['Blade-Requested-With'] = 'BladeHttpRequest'
diff --git a/applications/mobile-web-view/vite.config.mjs b/applications/mobile-web-view/vite.config.mjs
index 1277457..35b904e 100644
--- a/applications/mobile-web-view/vite.config.mjs
+++ b/applications/mobile-web-view/vite.config.mjs
@@ -6,7 +6,7 @@
import createVitePlugins from './vite/plugins'
import postCssPxToRem from 'postcss-pxtorem'
import { fileURLToPath, URL } from "node:url"
-
+import basic from '@vitejs/plugin-basic-ssl'
import fs from 'fs'
// https://vitejs.dev/config/
@@ -19,7 +19,8 @@
const {
VITE_APP_ENV,
VITE_APP_BASE,
- VITE_APP_XT_URL,
+ VITE_APP_API_URL,
+ VITE_APP_XT_URL,
VITE_APP_RECTANGLE,
VITE_APP_ARCGIS_URL,
VITE_APP_MAP_TILE_URL,
@@ -67,6 +68,7 @@
// key: fs.readFileSync('./127.0.0.1+3-key.pem'), // 私钥路径
// cert: fs.readFileSync('./127.0.0.1+3.pem'), // 证书路径
// },
+ https: true,
port: 5179,
proxy: {
'/aisky-webodm-vol': {
@@ -111,8 +113,14 @@
rewrite: path => path.replace(/^\/dji_in_rectangle/, ''),
},
- '/api': {
+ '/webservice': {
target: VITE_APP_XT_URL,
+ changeOrigin: true,
+ rewrite: path => path.replace(/^\/webservice/, '/webservice'),
+ },
+
+ '/api': {
+ target: VITE_APP_API_URL,
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, ''),
}
@@ -149,7 +157,8 @@
]
}
},
- plugins: createVitePlugins(env, command === 'build'),
+ plugins: [...createVitePlugins(env, command === 'build'), basic()],
+ // plugins: createVitePlugins(env, command === 'build'),
build: buildConfig,
optimizeDeps: {
esbuildOptions: {
--
Gitblit v1.9.3