# Conflicts: # src/main.js
@@ -62,7 +62,11 @@ import axios from 'axios';
Vue.prototype.$http = axios.create({
//设置20秒超时时间
timeout: 20000,
+<<<<<<< HEAD
baseURL: 'http://mes.ubtob.net:8099/mes/', //这里写后端地址http://localhost:8099/uas/()
+=======
+ baseURL: '/proxy_url', //这里写后端地址http://localhost:8099/uas/ https://mes.ubtob.net:8099/mes/
+>>>>>>> b58aeb0f125f678e23409708980deda3485dbecd
});
Vue.prototype.$http.interceptors.request.use(config => {
//为请求头添加x-access-token 字段为服务端返回的token
@@ -74,7 +74,7 @@
if (valid) {
console.log('登录',this.loginForm);
//?username=zhongyl&password=asd&sob=N_MES_TEST
- this.$http.get("kanban/login.action",this.loginForm).then(
+ this.$http.get("kanban/login.action",{params:{username:this.loginForm.username,password:this.loginForm.password,sob:this.loginForm.sob}}).then(
(result)=>{
console.info(result.data);
var res = result.data;
@@ -8,4 +8,16 @@ module.exports = {
config.resolve.alias
.set('_c', resolve('src/components')) // key,value自行定义,比如.set('@@', resolve('src/components'))
},
+ devServer: {
+ proxy: {
+ "/proxy_url":{ // /proxy_url 这个用来和根路径 baseURL 进行匹配
+ target:'http://mes.ubtob.net:8099/mes/', // 'http://localhost:8099/uas/' ,这个是填写跨域的请求域名+端口号,也就是要请求的URL(不包含URL路径)
+ changeOrigin: true, // 是否允许跨域请求,在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求的数据,这样服务端和服务端进行数据的交互就不会有跨域问题
+ pathRewrite: { // 路径重写
+ '^/proxy_url': '' // 替换target中的请求地址,原请求为 http://127.0.0.1:8000/kuayu 实际请求为 http://127.0.0.1:8000/proxy_url/kuayu
+ }
+
}