8000 egg-cors上可以添加白名单 · Issue #3 · temool/egg-origin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

egg-cors上可以添加白名单 #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an i 7ABE ssue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lizheng1991 opened this issue Jul 9, 2020 · 0 comments
Open

egg-cors上可以添加白名单 #3

lizheng1991 opened this issue Jul 9, 2020 · 0 comments

Comments

@lizheng1991
Copy link

//跨域配置
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'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0