Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
front-document
/
front-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 55d4b349
authored
Feb 24, 2022
by
luyt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add:change egg-core config
1 parent
e5e81f9d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
config/config.default.js
config/plugin.js
config/config.default.js
View file @
55d4b34
...
...
@@ -15,15 +15,16 @@ module.exports = appInfo => {
enable
:
false
,
ignoreJSON
:
true
},
domainWhiteList
:
[
"http://localhost:8080"
,
"http://192.168.2.9:8080"
,
"*"
]
//允许访问接口的白名单
domainWhiteList
:
[
'*'
]
// domainWhiteList: ["http://localhost:8080", "http://192.168.2.9:8080","http://glsk-front.test.glsx.com.cn",] //允许访问接口的白名单
};
config
.
cors
=
{
// 任何地址都可以访问
origin
:
"*"
,
origin
:
ctx
=>
ctx
.
get
(
'origin'
),
//这种方式是允许所有的IP+端口跨域访问
// 指定地址才可以访问
// origin: 'http://localhost:8080',
// allowMethods: 'GET,PUT,POST,DELETE
',
allowMethods
:
'*'
,
allowMethods
:
'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS
'
,
//
allowMethods: '*',
// cookie跨域配置
credentials
:
true
};
...
...
config/plugin.js
View file @
55d4b34
exports
.
sequelize
=
{
module
.
exports
=
{
sequelize
:{
enable
:
true
,
package
:
'egg-sequelize'
,
};
exports
.
cors
=
{
},
cors
:
{
enable
:
true
,
package
:
'egg-cors'
,
};
}
}
// exports.sequelize = {
// enable: true,
// package: 'egg-sequelize',
// };
// exports.cors = {
// enable: true,
// package: 'egg-cors',
// };
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment