@@ -10,6 +10,7 @@ const service = axios.create({ | |||
// `baseURL` 将自动加在 `url` 前面,除非 `url` 是一个绝对 URL。 | |||
// 它可以通过设置一个 `baseURL` 便于为 axios 实例的方法传递相对 URL | |||
baseURL: import.meta.env.VITE_APP_BASE_URL + '', | |||
//contentType: "application/x-www-form-urlencoded", | |||
// `headers` 是即将被发送的自定义请求头 | |||
headers: { | |||
"X-Requested-With": "XMLHttpRequest", | |||
@@ -85,7 +86,7 @@ export function get(url: string, data = {}, options = {}) { | |||
export function post(url: string, data = {}, options = {}) { | |||
const defaultOptions = { | |||
url: url, | |||
data: "post", | |||
method: "post", | |||
params: data, | |||
} | |||
//合并用户配置参数信息 |
@@ -450,8 +450,8 @@ const regcode = () => { | |||
// console.log(err); | |||
// }) | |||
proxy.$request.post('api/corporateaccount/queryPage', {}, { | |||
baseURL:'http://localhost:8089' | |||
proxy.$request.post('/corporateaccount/queryPage', {}, { | |||
baseURL:'http://localhost:8089', | |||
}).then((res) => { | |||
console.log(res); | |||
}).catch((err) => { |
@@ -54,6 +54,11 @@ export default defineConfig(({ command, mode }) => { | |||
changeOrigin: true, | |||
rewrite: path => path.replace(/^\/api/, '') //重写 | |||
} | |||
/*'/corporateaccount': { | |||
target: process.env.VUE_APP_BASE_API, | |||
changeOrigin: true, | |||
rewrite: path => path.replace(/^\/api/, '') //重写 | |||
},*/ | |||
}, | |||
}, | |||
// 生产环境打包配置 |