Commit c0b0c5c2 authored by wty's avatar wty

后端代码错误处理更新2

parent 30ba49a4
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment