feat: 登录接口环境调试

This commit is contained in:
duanshuwen
2025-12-21 22:48:23 +08:00
parent 2fb6a0d7e9
commit 72d1869f40
4 changed files with 14 additions and 3 deletions

View File

@@ -16,6 +16,7 @@ export function authOauth2TokenUsingPost({
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': 'Basic Y3VzdG9tUEM6Y3VzdG9tUEM=',
},
data: body,
...(options || {}),

View File

@@ -6,7 +6,8 @@ import { getToken } from '@utils/auth'
import { tansParams } from '@utils/tansParams'
// 获取.env中的服务地址
const { VITE_SERVICE_URL } = (import.meta as any).env
const { VITE_SERVICE_URL, DEV } = (import.meta as any).env
console.log("🚀 ~ DEV:", DEV)
// 是否显示重新登录
export let isRelogin = { show: false }
@@ -15,7 +16,7 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
// 创建axios对象
const instance = axios.create({
baseURL: VITE_SERVICE_URL,
baseURL: DEV ? '/ingress' : VITE_SERVICE_URL,
// 超时
timeout: 10000
})

View File

@@ -44,5 +44,14 @@ export default defineConfig(async () => {
"@locales": resolve(__dirname, "locales"),
},
},
server: {
proxy: {
'/ingress': {
target: 'http://8.138.234.141',
changeOrigin: true,
},
},
},
}
});