Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
Dui123
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
王天宇
Dui123
Commits
c98d58c7
Commit
c98d58c7
authored
Nov 02, 2021
by
wty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改页面7
parent
4268f9d0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
2 deletions
+39
-2
getConfig.js
config/getConfig.js
+13
-0
prod.json
config/prod.json
+12
-0
test.json
config/test.json
+12
-0
SQLPool.js
server/SQLPool.js
+2
-2
No files found.
config/getConfig.js
0 → 100644
View file @
c98d58c7
const
env
=
'test'
const
getConfig
=
()
=>
{
switch
(
env
){
case
'dev'
:
return
require
(
'../config/dev.json'
)
case
'prod'
:
return
require
(
'../config/prod.json'
)
case
'test'
:
return
require
(
'../config/test.json'
)
}
}
module
.
exports
=
getConfig
config/prod.json
0 → 100644
View file @
c98d58c7
{
"PORT"
:
"3000"
,
"API_HOST"
:
"//dui123.duiba.com.cn"
,
"SSO"
:
{
"ssourl"
:
"http://sso.duiba.com.cn"
,
"systemId"
:
491
,
"appSecret"
:
"9e51dbe27cf3eb68e5686a4a433ae14b"
,
"systemName"
:
"duiba-aurora-node"
,
"profiles"
:
"prod"
},
"remote_config_url"
:
"http://configserver.duiba.com/dui123/prod?accessKey=98e72000586f43e3b55da663c9f8af72"
}
config/test.json
0 → 100644
View file @
c98d58c7
{
"PORT"
:
"3000"
,
"API_HOST"
:
"//dui123.duibatest.com.cn"
,
"SSO"
:
{
"ssourl"
:
"http://sso.duibatest.com.cn"
,
"systemId"
:
491
,
"appSecret"
:
"78b6cf42fe15f8b7bbaececea9bb2a6d"
,
"systemName"
:
"duiba-aurora-node"
,
"profiles"
:
"test"
},
"remote_config_url"
:
"http://configserver.dui88.com/dui123/test?accessKey=81edd6d7523e41d7bf87f303b12b3c75"
}
server/SQLPool.js
View file @
c98d58c7
const
MYSQL
=
require
(
'mysql'
)
const
config
=
require
(
'../config/dev.json'
)
const
request
=
require
(
'request'
)
const
config
=
require
(
'../config/getConfig'
)()
//应用数据库
const
getMysql
=
new
Promise
((
resolve
)
=>
{
request
(
config
[
'remote_config_url'
],{},(
error
,
request
,
body
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment