Skip to content

Commit

Permalink
Merge pull request #24 from rhinel/test
Browse files Browse the repository at this point in the history
修复一个接口问题,月度为空时前端响应
  • Loading branch information
rhinel authored Dec 21, 2017
2 parents 487d2bd + 0712f3a commit fd2fc44
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ yarn-debug.log*
yarn-error.log*
debug.log

logback/
log/*
logs/*
server-node/auth.js
dist.tar.bz2

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ npm run build

## 待解决问题

时区问题,前端添加为+0800时区,服务器时间为0时区<br>
时区问题,前端添加为+0800时区,服务器时间为0时区,要注意修改服务器时区为+0800<br>
mongodb没有事务的问题,目前解决方式是判断可能出错的读取后执行,但高并发可能会有问题
1 change: 0 additions & 1 deletion server-node/config-codes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

const log4js = require('log4js')

const FoundError = require('./config-error')
Expand Down
13 changes: 8 additions & 5 deletions server-node/config-log.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,46 @@ const path = require('path')

module.exports = {
appenders: {
// HTTP 请求日志
// HTTP日志,请求日志
http: {
type: 'dateFile',
filename: `${path.resolve(__dirname, '../logs/httpLogs/logs')}Http.log`,
maxLogSize: 102400,
backups: 1024,
},
// 系统日志,如:框架错误,catch程序错误,db连接错误等

// 系统日志,如:程序启动和db链接日志,框架错误,catch框架错误,db连接错误等
sys: {
type: 'dateFile',
filename: `${path.resolve(__dirname, '../logs/sysLogs/logs')}Sys.log`,
maxLogSize: 102400,
backups: 1024,
},

// 所有登录登出等的日志
// 登陆日志,所有登录登出等的日志
login: {
type: 'dateFile',
filename: `${path.resolve(__dirname, '../logs/loginLogs/logs')}Login.log`,
maxLogSize: 102400,
backups: 1024,
},
// 所有API请求产生的错误日志

// APIERROR日志,所有API请求产生的错误日志
apiError: {
type: 'dateFile',
filename: `${path.resolve(__dirname, '../logs/apiErrorLogs/logs')}apiError.log`,
maxLogSize: 102400,
backups: 1024,
},

// 所有的错误日志
// 错误日志,所有的错误日志
errorsFile: {
type: 'dateFile',
filename: `${path.resolve(__dirname, '../logs/errorsFileLogs/logs')}ErrorsFile.log`,
maxLogSize: 102400,
backups: 1024,
},

errors: {
type: 'logLevelFilter',
appender: 'errorsFile',
Expand Down
2 changes: 0 additions & 2 deletions server-node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ db.connect()

// 启动路由及端口处理
const app = express()

// http转发
const httpServer = http.createServer(app)
const httpPORT = process.env.npm_config_port || 80

Expand Down
1 change: 0 additions & 1 deletion server-node/services-auth.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

const superagent = require('superagent')
const md5 = require('md5')

Expand Down
4 changes: 4 additions & 0 deletions server-node/services-rent.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,10 @@ module.exports = {

const houseAndMonth = await Promise.all([houseInfo(), monthInfo()])

if (!houseAndMonth[1]) {
return Promise.reject(new FoundError('暂无最新月度信息'))
}

// 2再根据monthId查询月度信息
const rentInfo = await db
.dbModel('rent')
Expand Down

0 comments on commit fd2fc44

Please sign in to comment.