From 2a0e798513986b5ecfae7fdacfcdbea0bc7b5087 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Thu, 05 Feb 2026 11:22:57 +0800
Subject: [PATCH] feat: 代理

---
 applications/mobile-web-view/src/axios.js |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/applications/mobile-web-view/src/axios.js b/applications/mobile-web-view/src/axios.js
index 2087131..a56b013 100644
--- a/applications/mobile-web-view/src/axios.js
+++ b/applications/mobile-web-view/src/axios.js
@@ -20,7 +20,7 @@
 import { getStore } from '@/utils/store'
 import { showToast } from 'vant'
 
-let baseUrl = import.meta.env.VITE_APP_API
+let { VITE_APP_ENV,VITE_APP_XT_URL,VITE_APP_API } = import.meta.env
 // 全局未授权错误提示状态,只提示一次
 let isErrorShown = false
 // 全局锁机制相关变量
@@ -48,18 +48,21 @@
 		// 初始化错误提示状态
 		isErrorShown = false
 		//地址为已经配置状态则不添加前缀
-		if (!isBase && !isURL(config.url) && !config.url.startsWith(baseUrl)) {
-			config.url = baseUrl + config.url
+		if (!isBase && !isURL(config.url) && !config.url.startsWith(VITE_APP_API)) {
+			config.url = VITE_APP_API + config.url
 		}
+		config.url = VITE_APP_ENV === 'development' ? config.url : VITE_APP_XT_URL + config.url
 
 		config.headers['areaCode'] = store.state.user.selectedAreaCode
 		//安全请求header
 		config.headers['Blade-Requested-With'] = 'BladeHttpRequest'
 		//headers判断是否需要
-		const authorization = config.authorization === false
-		if (!authorization) {
-			config.headers['Authorization'] = `Basic ${Base64.encode(`${website.clientId}:${website.clientSecret}`)}`
-		}
+		// const authorization = config.authorization === false
+		// if (!authorization) {
+		// 	config.headers['Authorization'] = `Basic ${Base64.encode(`${website.clientId}:${website.clientSecret}`)}`
+		// }
+		let authorization = store.state.user.token
+		config.headers['Authorization'] = authorization
 		// 根据后端要求,post的data为空的话传{}
 		if (config.method === 'post') {
 			config.data = config.data || {}

--
Gitblit v1.9.3