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 e5e81f9d
authored
Feb 24, 2022
by
luyt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add: egg-core
1 parent
72cf3bbd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
config/config.default.js
config/plugin.js
package.json
config/config.default.js
View file @
e5e81f9
...
...
@@ -17,5 +17,16 @@ module.exports = appInfo => {
},
domainWhiteList
:
[
"http://localhost:8080"
,
"http://192.168.2.9:8080"
,
"*"
]
//允许访问接口的白名单
};
config
.
cors
=
{
// 任何地址都可以访问
origin
:
"*"
,
// 指定地址才可以访问
// origin: 'http://localhost:8080',
// allowMethods: 'GET,PUT,POST,DELETE',
allowMethods
:
'*'
,
// cookie跨域配置
credentials
:
true
};
return
config
}
\ No newline at end of file
config/plugin.js
View file @
e5e81f9
...
...
@@ -2,3 +2,7 @@ exports.sequelize = {
enable
:
true
,
package
:
'egg-sequelize'
,
};
exports
.
cors
=
{
enable
:
true
,
package
:
'egg-cors'
,
};
package.json
View file @
e5e81f9
...
...
@@ -11,6 +11,7 @@
"license"
:
"ISC"
,
"dependencies"
:
{
"egg"
:
"^2.30.0"
,
"egg-cors"
:
"^2.2.3"
,
"egg-sequelize"
:
"^5.2.1"
,
"mysql2"
:
"^2.3.0"
},
...
...
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