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
c0b0c5c2
Commit
c0b0c5c2
authored
Oct 20, 2021
by
wty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后端代码错误处理更新2
parent
30ba49a4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
19 deletions
+19
-19
app.js
server/app.js
+18
-18
users.js
server/routes/users.js
+1
-1
No files found.
server/app.js
View file @
c0b0c5c2
...
...
@@ -14,8 +14,8 @@ const submitRouter = require('./routes/page')
const
typeManage
=
require
(
'./routes/typeManage'
)
const
app
=
express
();
// global.domain = 'http://dui123.dui88
.com:3000'
global
.
domain
=
'http://127.0.0.1:3001'
global
.
domain
=
'http://dui123.dui88dev
.com:3000'
//
global.domain = 'http://127.0.0.1:3001'
const
Eureka
=
require
(
'eureka-node'
).
default
const
DockerApp
=
require
(
'docker-app-node'
)
...
...
@@ -27,22 +27,22 @@ const pkg = require('./package.json')
// 获取配置的端口号
const
port
=
3000
//
const dockerApp = new DockerApp({
//
app,
//
appType: 'express',
//
port
//
})
//
//
//
注册Eureka
//
global.eureka = new Eureka({
//
port, // 应用端口号
//
appName: pkg.name, // 应用名称
//
services: ['KJY-WEB'] // 依赖服务名
//
})
//
//
global.eureka.start().then(() => {
//
dockerApp.startServer()
//
})
const
dockerApp
=
new
DockerApp
({
app
,
appType
:
'express'
,
port
})
// 注册Eureka
global
.
eureka
=
new
Eureka
({
port
,
// 应用端口号
appName
:
pkg
.
name
,
// 应用名称
services
:
[
'KJY-WEB'
]
// 依赖服务名
})
global
.
eureka
.
start
().
then
(()
=>
{
dockerApp
.
startServer
()
})
app
.
use
((
req
,
res
,
next
)
=>
{
const
url
=
req
.
url
...
...
server/routes/users.js
View file @
c0b0c5c2
...
...
@@ -23,7 +23,7 @@ router.get('/getUser', function (req, res, next) {
// }
const
SQL
=
'SELECT * FROM `user` WHERE `user`.uid = ?'
Mysql
.
query
(
SQL
,
[
uid
],
(
err
,
result
)
=>
{
if
(
err
||
!
result
)
{
if
(
err
||
!
result
||
Object
.
keys
(
result
).
length
)
{
res
.
send
({
success
:
false
,
err
...
...
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