feat: 登录接口环境调试
This commit is contained in:
2
.env
2
.env
@@ -1,4 +1,4 @@
|
|||||||
APIFOX_PROJECT_ID = 7574669
|
APIFOX_PROJECT_ID = 7574669
|
||||||
APIFOX_ACCESS_TOKEN = APS-20xZ4VqkdY1I1GC63EPVJHbJGsM4VMqy
|
APIFOX_ACCESS_TOKEN = APS-20xZ4VqkdY1I1GC63EPVJHbJGsM4VMqy
|
||||||
|
|
||||||
VITE_SERVICE_URL = http://8.138.234.141/ingress
|
VITE_SERVICE_URL = http://8.138.234.141/ingress
|
||||||
@@ -16,6 +16,7 @@ export function authOauth2TokenUsingPost({
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
|
'Authorization': 'Basic Y3VzdG9tUEM6Y3VzdG9tUEM=',
|
||||||
},
|
},
|
||||||
data: body,
|
data: body,
|
||||||
...(options || {}),
|
...(options || {}),
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ import { getToken } from '@utils/auth'
|
|||||||
import { tansParams } from '@utils/tansParams'
|
import { tansParams } from '@utils/tansParams'
|
||||||
|
|
||||||
// 获取.env中的服务地址
|
// 获取.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 }
|
export let isRelogin = { show: false }
|
||||||
@@ -15,7 +16,7 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
|
|||||||
|
|
||||||
// 创建axios对象
|
// 创建axios对象
|
||||||
const instance = axios.create({
|
const instance = axios.create({
|
||||||
baseURL: VITE_SERVICE_URL,
|
baseURL: DEV ? '/ingress' : VITE_SERVICE_URL,
|
||||||
// 超时
|
// 超时
|
||||||
timeout: 10000
|
timeout: 10000
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -44,5 +44,14 @@ export default defineConfig(async () => {
|
|||||||
"@locales": resolve(__dirname, "locales"),
|
"@locales": resolve(__dirname, "locales"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
server: {
|
||||||
|
proxy: {
|
||||||
|
'/ingress': {
|
||||||
|
target: 'http://8.138.234.141',
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user