Commit c0b0c5c2 authored by wty's avatar wty

后端代码错误处理更新2

parent 30ba49a4
...@@ -14,8 +14,8 @@ const submitRouter = require('./routes/page') ...@@ -14,8 +14,8 @@ const submitRouter = require('./routes/page')
const typeManage = require('./routes/typeManage') const typeManage = require('./routes/typeManage')
const app = express(); const app = express();
// global.domain = 'http://dui123.dui88.com:3000' global.domain = 'http://dui123.dui88dev.com:3000'
global.domain = 'http://127.0.0.1:3001' // global.domain = 'http://127.0.0.1:3001'
const Eureka = require('eureka-node').default const Eureka = require('eureka-node').default
const DockerApp = require('docker-app-node') const DockerApp = require('docker-app-node')
...@@ -27,22 +27,22 @@ const pkg = require('./package.json') ...@@ -27,22 +27,22 @@ const pkg = require('./package.json')
// 获取配置的端口号 // 获取配置的端口号
const port = 3000 const port = 3000
// const dockerApp = new DockerApp({ const dockerApp = new DockerApp({
// app, app,
// appType: 'express', appType: 'express',
// port port
// }) })
//
// // 注册Eureka // 注册Eureka
// global.eureka = new Eureka({ global.eureka = new Eureka({
// port, // 应用端口号 port, // 应用端口号
// appName: pkg.name, // 应用名称 appName: pkg.name, // 应用名称
// services: ['KJY-WEB'] // 依赖服务名 services: ['KJY-WEB'] // 依赖服务名
// }) })
//
// global.eureka.start().then(() => { global.eureka.start().then(() => {
// dockerApp.startServer() dockerApp.startServer()
// }) })
app.use((req, res, next) => { app.use((req, res, next) => {
const url = req.url const url = req.url
......
...@@ -23,7 +23,7 @@ router.get('/getUser', function (req, res, next) { ...@@ -23,7 +23,7 @@ router.get('/getUser', function (req, res, next) {
// } // }
const SQL = 'SELECT * FROM `user` WHERE `user`.uid = ?' const SQL = 'SELECT * FROM `user` WHERE `user`.uid = ?'
Mysql.query(SQL, [uid], (err, result) => { Mysql.query(SQL, [uid], (err, result) => {
if (err || !result) { if (err || !result || Object.keys(result).length) {
res.send({ res.send({
success: false, success: false,
err 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