服务器代理

This commit is contained in:
刘玉霞 2024-06-27 14:29:33 +08:00
parent d438bdaf07
commit 2f63d39281
3 changed files with 4 additions and 5 deletions

View File

@ -5,7 +5,7 @@ ENV = 'development'
VITE_BASE_PATH = './'
# 代理配置(开发使用),必须在一行中
VITE_APP_PROXY=[["/api","http://192.168.130.12:8080/api"]]
VITE_APP_PROXY=[["/api","https://test.jsspisoft.com/api"]]
# 开发环境下跨域代理请输入要跨域的api地址 - 尾部无需带'/'
# VITE_PROXY_URL = 'http://localhost:8000'

View File

@ -90,13 +90,11 @@ function createAxios<Data = any, T = ApiPromise<Data>>(axiosConfig: AxiosRequest
if (config.method === 'post' && config.data) {
// 对data进行加密
// const formData = new FormData()
// formData.append('param')
console.log(config.data)
config.data = encrypt_aes(config.data, v)
} else if (config.method === 'get' && config.params) {
// 对params进行加密
// const formData = new FormData()
// formData.append('param')
console.log(config.params)
config.params = encrypt_aes(config.params, v)
}

View File

@ -1,6 +1,7 @@
import CryptoJS from 'crypto-js'
const key = 'b6967ee87b86d85a'
const ivv = '6920559358617460'
export function encrypt_aes(text: any, iv: string) {
let plaintText = text