//跨域配置
config.security = {
csrf: {
enable: false, // 前后端分离,post请求不方便携带_csrf
ignoreJSON: true
},
domainWhiteList: ['http://www.baidu.com', 'http://localhost:8080'], //配置白名单
};
config.cors = {
// origin: '*', //允许所有跨域访问,注释掉则允许上面 白名单 访问
credentials: true, // 允许跨域请求携带cookies
allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH'
}
//跨域配置
config.security = {
csrf: {
enable: false, // 前后端分离,post请求不方便携带_csrf
ignoreJSON: true
},
domainWhiteList: ['http://www.baidu.com', 'http://localhost:8080'], //配置白名单
};
config.cors = {
// origin: '*', //允许所有跨域访问,注释掉则允许上面 白名单 访问
credentials: true, // 允许跨域请求携带cookies
allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH'
}