13
14
-8x
-8x
-8x
+2x
+2x
+2x
-8x
-8x
+2x
+2x
-8x
-8x
-8x
-8x | 'use strict'
+2x
+2x
+2x
+2x | 'use strict'
const router = require('koa-router')()
const controller = require('./comment.controller')
@@ -88,7 +88,7 @@
diff --git a/coverage/server/api/logs/index.html b/coverage/server/api/logs/index.html
index 4e0318e..ed2c05a 100644
--- a/coverage/server/api/logs/index.html
+++ b/coverage/server/api/logs/index.html
@@ -20,28 +20,28 @@
- 100%
+ 42.11%
Statements
- 19/19
+ 8/19
- 100%
+ 0%
Branches
- 8/8
+ 0/8
- 100%
+ 50%
Functions
- 2/2
+ 1/2
- 100%
+ 42.11%
Lines
- 19/19
+ 8/19
-
+
@@ -72,16 +72,16 @@
- logs.controller.js |
- |
- 100% |
- 14/14 |
- 100% |
- 8/8 |
- 100% |
- 2/2 |
- 100% |
- 14/14 |
+ logs.controller.js |
+ |
+ 21.43% |
+ 3/14 |
+ 0% |
+ 0/8 |
+ 50% |
+ 1/2 |
+ 21.43% |
+ 3/14 |
@@ -90,7 +90,7 @@
diff --git a/coverage/server/api/logs/index.js.html b/coverage/server/api/logs/index.js.html
index ee6d201..e3239dd 100644
--- a/coverage/server/api/logs/index.js.html
+++ b/coverage/server/api/logs/index.js.html
@@ -53,13 +53,13 @@
8
9
-8x
-8x
-8x
+2x
+2x
+2x
-8x
+2x
-8x | 'use strict'
+2x | 'use strict'
const router = require('koa-router')()
const controller = require('./logs.controller')
@@ -73,7 +73,7 @@
diff --git a/coverage/server/api/logs/logs.controller.js.html b/coverage/server/api/logs/logs.controller.js.html
index 0264c74..4e6c3fc 100644
--- a/coverage/server/api/logs/logs.controller.js.html
+++ b/coverage/server/api/logs/logs.controller.js.html
@@ -20,28 +20,28 @@
- 100%
+ 21.43%
Statements
- 14/14
+ 3/14
- 100%
+ 0%
Branches
- 8/8
+ 0/8
- 100%
+ 50%
Functions
- 2/2
+ 1/2
- 100%
+ 21.43%
Lines
- 14/14
+ 3/14
-
+
1
2
@@ -65,43 +65,43 @@
20
21 |
-8x
-8x
-
-26x
-2x
2x
2x
-2x
-2x
-2x
-1x
+6x
+
+
+
-2x
-2x
-2x
-2x
+
+
+
+
+
+
+
+
+
| 'use strict'
const mongoose = require('mongoose')
const Logs = mongoose.model('Logs')
-exports.getLogsList = async (ctx, next)=>{
- let currentPage = (parseInt(ctx.query.currentPage) > 0)?parseInt(ctx.query.currentPage):1
- let itemsPerPage = (parseInt(ctx.query.itemsPerPage) > 0)?parseInt(ctx.query.itemsPerPage):10
- let startRow = (currentPage - 1) * itemsPerPage
+exports.getLogsList = async (ctx, next)=>{
+ let currentPage = (parseInt(ctx.query.currentPage) > 0)?parseInt(ctx.query.currentPage):1
+ let itemsPerPage = (parseInt(ctx.query.itemsPerPage) > 0)?parseInt(ctx.query.itemsPerPage):10
+ let startRow = (currentPage - 1) * itemsPerPage
- let sortName = String(ctx.query.sortName) || 'created'
- let sortOrder = ctx.query.sortOrder
- if(sortOrder === 'false'){
- sortName = '-' + sortName
+ let sortName = String(ctx.query.sortName) || 'created'
+ let sortOrder = ctx.query.sortOrder
+ if(sortOrder === 'false'){
+ sortName = '-' + sortName
}
- const logsList = await Logs.find({}).skip(startRow).limit(itemsPerPage).sort(sortName).exec()
- const count = await Logs.count()
- ctx.status = 200
- ctx.body = { data: logsList,count:count }
+ const logsList = await Logs.find({}).skip(startRow).limit(itemsPerPage).sort(sortName).exec()
+ const count = await Logs.count()
+ ctx.status = 200
+ ctx.body = { data: logsList,count:count }
}
|
@@ -109,7 +109,7 @@
diff --git a/coverage/server/api/mobile/index.html b/coverage/server/api/mobile/index.html
index d3d0476..7ace913 100644
--- a/coverage/server/api/mobile/index.html
+++ b/coverage/server/api/mobile/index.html
@@ -20,28 +20,28 @@
- 90%
+ 60%
Statements
- 9/10
+ 6/10
- 50%
+ 0%
Branches
- 1/2
+ 0/2
- 100%
+ 50%
Functions
- 2/2
+ 1/2
- 90%
+ 60%
Lines
- 9/10
+ 6/10
-
+
@@ -72,16 +72,16 @@
- mobile.controller.js |
- |
- 83.33% |
- 5/6 |
+ mobile.controller.js |
+ |
+ 33.33% |
+ 2/6 |
+ 0% |
+ 0/2 |
50% |
1/2 |
- 100% |
- 2/2 |
- 83.33% |
- 5/6 |
+ 33.33% |
+ 2/6 |
@@ -90,7 +90,7 @@
diff --git a/coverage/server/api/mobile/index.js.html b/coverage/server/api/mobile/index.js.html
index 12b9423..fca9ded 100644
--- a/coverage/server/api/mobile/index.js.html
+++ b/coverage/server/api/mobile/index.js.html
@@ -52,12 +52,12 @@
7
8
-8x
-8x
+2x
+2x
-8x
+2x
-8x | 'use strict'
+2x | 'use strict'
const router = require('koa-router')()
const controller = require('./mobile.controller')
@@ -70,7 +70,7 @@
diff --git a/coverage/server/api/mobile/mobile.controller.js.html b/coverage/server/api/mobile/mobile.controller.js.html
index 0c10363..0874c2a 100644
--- a/coverage/server/api/mobile/mobile.controller.js.html
+++ b/coverage/server/api/mobile/mobile.controller.js.html
@@ -20,28 +20,28 @@
- 83.33%
+ 33.33%
Statements
- 5/6
+ 2/6
- 50%
+ 0%
Branches
- 1/2
+ 0/2
- 100%
+ 50%
Functions
- 2/2
+ 1/2
- 83.33%
+ 33.33%
Lines
- 5/6
+ 2/6
-
+
1
2
@@ -57,12 +57,12 @@
12
13 |
-8x
+2x
-25x
-1x
-1x
-1x
+6x
+
+
+
@@ -71,10 +71,10 @@
const config = require('../../config/env')
-exports.getApps = async (ctx)=>{
- Eif(config.apps){
- ctx.status = 200
- ctx.body = {success:true,data:config.apps}
+exports.getApps = async (ctx)=>{
+ if(config.apps){
+ ctx.status = 200
+ ctx.body = {success:true,data:config.apps}
}else{
ctx.throw(404)
}
@@ -85,7 +85,7 @@
diff --git a/coverage/server/api/tags/index.html b/coverage/server/api/tags/index.html
index 2516d3f..f1bc8ad 100644
--- a/coverage/server/api/tags/index.html
+++ b/coverage/server/api/tags/index.html
@@ -20,28 +20,28 @@
- 93.52%
+ 24.07%
Statements
- 101/108
+ 26/108
- 90%
+ 0%
Branches
- 18/20
+ 0/20
- 100%
+ 50%
Functions
- 18/18
+ 9/18
- 93.52%
+ 24.07%
Lines
- 101/108
+ 26/108
-
+
@@ -72,16 +72,16 @@
- tags.controller.js |
- |
- 92.63% |
- 88/95 |
- 90% |
- 18/20 |
- 100% |
- 18/18 |
- 92.63% |
- 88/95 |
+ tags.controller.js |
+ |
+ 13.68% |
+ 13/95 |
+ 0% |
+ 0/20 |
+ 50% |
+ 9/18 |
+ 13.68% |
+ 13/95 |
@@ -90,7 +90,7 @@
diff --git a/coverage/server/api/tags/index.js.html b/coverage/server/api/tags/index.js.html
index 6107f5b..fe95dca 100644
--- a/coverage/server/api/tags/index.js.html
+++ b/coverage/server/api/tags/index.js.html
@@ -61,21 +61,21 @@
16
17
-8x
-8x
-8x
+2x
+2x
+2x
-8x
-8x
-8x
-8x
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
+2x
+2x
+2x
+2x
-8x
-8x | 'use strict'
+2x
+2x | 'use strict'
const router = require('koa-router')()
const controller = require('./tags.controller')
@@ -97,7 +97,7 @@
diff --git a/coverage/server/api/tags/tags.controller.js.html b/coverage/server/api/tags/tags.controller.js.html
index db55256..a7d27db 100644
--- a/coverage/server/api/tags/tags.controller.js.html
+++ b/coverage/server/api/tags/tags.controller.js.html
@@ -20,28 +20,28 @@
- 92.63%
+ 13.68%
Statements
- 88/95
+ 13/95
- 90%
+ 0%
Branches
- 18/20
+ 0/20
- 100%
+ 50%
Functions
- 18/18
+ 9/18
- 92.63%
+ 13.68%
Lines
- 88/95
+ 13/95
-
+
1
2
@@ -200,119 +200,119 @@
155
156 |
-8x
-8x
-8x
-8x
-
-
-27x
-3x
-3x
-1x
-1x
-
2x
2x
2x
-1x
-1x
+2x
-1x
-1x
-1x
+
+6x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-25x
-1x
-1x
-1x
-1x
+6x
+
+
+
+
-25x
-1x
-1x
-1x
+6x
+
+
+
-1x
-1x
-1x
-1x
+
+
+
+
-27x
-3x
-3x
-3x
-2x
-1x
-1x
+6x
+
+
+
+
+
+
-1x
-1x
-1x
+
+
+
-1x
+
-26x
-2x
-2x
-2x
-1x
+6x
+
+
+
+
-2x
-2x
+
+
-2x
-2x
+
+
-28x
+6x
-4x
-4x
+
+
-4x
-1x
-3x
-1x
+
+
+
+
-4x
-2x
-2x
+
+
+
-2x
-2x
-2x
-1x
-1x
+
+
+
+
+
-1x
-1x
-1x
+
+
+
@@ -320,36 +320,36 @@
-26x
-2x
-2x
-2x
-1x
-1x
+6x
+
+
+
+
+
-1x
+
-25x
-1x
-1x
-1x
+6x
+
+
+
-1x
-1x
-1x
-1x
+
+
+
+
-25x
-1x
-1x
-1x
-1x
+6x
+
+
+
+
@@ -361,113 +361,113 @@
const Tag = mongoose.model('Tag')
//添加添签分类.
-exports.addTagCat = async (ctx, next)=>{
- const catName = ctx.request.body.name
- if(!catName){
- ctx.status = 422
- return ctx.body = {error_msg:'标签分类名称不能为空.'}
+exports.addTagCat = async (ctx, next)=>{
+ const catName = ctx.request.body.name
+ if(!catName){
+ ctx.status = 422
+ return ctx.body = {error_msg:'标签分类名称不能为空.'}
}
- try{
- const cat = await TagCategory.findOne({name:catName})
- if(cat){
- ctx.status = 403
- return ctx.body = {error_msg:'分类名称已经存在.'}
+ try{
+ const cat = await TagCategory.findOne({name:catName})
+ if(cat){
+ ctx.status = 403
+ return ctx.body = {error_msg:'分类名称已经存在.'}
}
- const result = await TagCategory.create(ctx.request.body)
- ctx.status = 200
- ctx.body = {success:true,cat_id:result._id}
+ const result = await TagCategory.create(ctx.request.body)
+ ctx.status = 200
+ ctx.body = {success:true,cat_id:result._id}
}catch(err){
ctx.throw(err)
}
}
//获取分类列表
-exports.getTagCatList = async (ctx, next)=>{
- try{
- const result = await TagCategory.find()
- ctx.status = 200
- ctx.body = {success:true,data:result}
+exports.getTagCatList = async (ctx, next)=>{
+ try{
+ const result = await TagCategory.find()
+ ctx.status = 200
+ ctx.body = {success:true,data:result}
}catch(err){
ctx.throw(err)
}
}
//更新分类
-exports.updateTagCat = async (ctx, next)=>{
- const id = ctx.params.id
- Eif(ctx.request.body._id){
- delete ctx.request.body._id
+exports.updateTagCat = async (ctx, next)=>{
+ const id = ctx.params.id
+ if(ctx.request.body._id){
+ delete ctx.request.body._id
}
- try{
- const result = await TagCategory.findByIdAndUpdate(id,ctx.request.body,{new:true})
- ctx.status = 200
- ctx.body = {success:true,cat_id:result._id}
+ try{
+ const result = await TagCategory.findByIdAndUpdate(id,ctx.request.body,{new:true})
+ ctx.status = 200
+ ctx.body = {success:true,cat_id:result._id}
}catch(err){
ctx.throw(err)
}
}
//删除分类
//(如果分类下有标签,则不可删除)
-exports.delTagCat = async (ctx, next)=>{
- const id = ctx.params.id
- try{
- const tag = await Tag.findOne({cid:id})
- if(tag){
- ctx.status = 403
- ctx.body = {error_msg:'此分类下有标签不可删除.'}
+exports.delTagCat = async (ctx, next)=>{
+ const id = ctx.params.id
+ try{
+ const tag = await Tag.findOne({cid:id})
+ if(tag){
+ ctx.status = 403
+ ctx.body = {error_msg:'此分类下有标签不可删除.'}
}else{
- await TagCategory.findByIdAndRemove(id)
- ctx.status = 200
- ctx.body = {success:true}
+ await TagCategory.findByIdAndRemove(id)
+ ctx.status = 200
+ ctx.body = {success:true}
}
}catch(err){
- ctx.throw(err)
+ ctx.throw(err)
}
}
//获取标签列表
-exports.getTagList = async (ctx, next)=>{
- const cid = ctx.params.id
- let condition = {}
- if(cid != 0){
- condition = {cid:cid}
+exports.getTagList = async (ctx, next)=>{
+ const cid = ctx.params.id
+ let condition = {}
+ if(cid != 0){
+ condition = {cid:cid}
}
- try{
- const tagList = await Tag.find(condition)
+ try{
+ const tagList = await Tag.find(condition)
.sort('sort')
.populate('cid')
.exec()
- ctx.status = 200
- ctx.body = {success:true,data:tagList}
+ ctx.status = 200
+ ctx.body = {success:true,data:tagList}
}catch(err){
ctx.throw(err)
}
}
//添加标签
-exports.addTag = async (ctx, next)=>{
+exports.addTag = async (ctx, next)=>{
//标签名称不能重复,标签分类名称必须有.
- const cid = ctx.request.body.cid
- const tagName = ctx.request.body.name
+ const cid = ctx.request.body.cid
+ const tagName = ctx.request.body.name
let error_msg
- if(!tagName){
- error_msg = '标签名称不能为空.'
- }else if(!cid){
- error_msg = '必须选择一个标签分类.'
+ if(!tagName){
+ error_msg = '标签名称不能为空.'
+ }else if(!cid){
+ error_msg = '必须选择一个标签分类.'
}
- if(error_msg){
- ctx.status = 422
- return ctx.body = {error_msg:error_msg}
+ if(error_msg){
+ ctx.status = 422
+ return ctx.body = {error_msg:error_msg}
}
- try{
- const tag = await Tag.findOne({name:tagName})
- if(tag){
- ctx.status = 403
- return ctx.body = {error_msg:'标签名称已经存在.'}
+ try{
+ const tag = await Tag.findOne({name:tagName})
+ if(tag){
+ ctx.status = 403
+ return ctx.body = {error_msg:'标签名称已经存在.'}
}else{
- const result = await Tag.create(ctx.request.body)
- ctx.status = 200
- ctx.body = {success:true,tag_id:result._id}
+ const result = await Tag.create(ctx.request.body)
+ ctx.status = 200
+ ctx.body = {success:true,tag_id:result._id}
}
}catch(err){
ctx.throw(err)
@@ -475,36 +475,36 @@
}
//删除标签
-exports.deleteTag = async (ctx, next)=>{
- const id = ctx.params.id
- try{
- await Tag.findByIdAndRemove(id)
- ctx.status = 200
- ctx.body = {success:true}
+exports.deleteTag = async (ctx, next)=>{
+ const id = ctx.params.id
+ try{
+ await Tag.findByIdAndRemove(id)
+ ctx.status = 200
+ ctx.body = {success:true}
}catch(err){
- ctx.throw(err)
+ ctx.throw(err)
}
}
//更新标签
-exports.updateTag = async (ctx, next)=>{
- const id = ctx.params.id
- Eif(ctx.request.body._id){
- delete ctx.request.body._id
+exports.updateTag = async (ctx, next)=>{
+ const id = ctx.params.id
+ if(ctx.request.body._id){
+ delete ctx.request.body._id
}
- try{
- const result = await Tag.findByIdAndUpdate(id,ctx.request.body,{new:true})
- ctx.status = 200
- ctx.body = {success:true,tag_id:result._id}
+ try{
+ const result = await Tag.findByIdAndUpdate(id,ctx.request.body,{new:true})
+ ctx.status = 200
+ ctx.body = {success:true,tag_id:result._id}
}catch(err){
ctx.throw(err)
}
}
//前台数据
-exports.getFrontTagList = async (ctx, next)=>{
- try{
- const result = await Tag.find({is_show:true},{},{sort:{'sort':-1}})
- ctx.status = 200
- ctx.body = {data:result}
+exports.getFrontTagList = async (ctx, next)=>{
+ try{
+ const result = await Tag.find({is_show:true},{},{sort:{'sort':-1}})
+ ctx.status = 200
+ ctx.body = {data:result}
}catch(err){
ctx.throw(err)
}
@@ -514,7 +514,7 @@
diff --git a/coverage/server/api/users/index.html b/coverage/server/api/users/index.html
index 93270ee..545d22d 100644
--- a/coverage/server/api/users/index.html
+++ b/coverage/server/api/users/index.html
@@ -20,28 +20,28 @@
- 92.7%
+ 19.71%
Statements
- 127/137
+ 27/137
- 89.04%
+ 0%
Branches
- 65/73
+ 0/73
- 94.44%
+ 50%
Functions
- 17/18
+ 9/18
- 92.7%
+ 19.71%
Lines
- 127/137
+ 27/137
-
+
@@ -72,16 +72,16 @@
- user.controller.js |
- |
- 91.94% |
- 114/124 |
- 89.04% |
- 65/73 |
- 94.44% |
- 17/18 |
- 91.94% |
- 114/124 |
+ user.controller.js |
+ |
+ 11.29% |
+ 14/124 |
+ 0% |
+ 0/73 |
+ 50% |
+ 9/18 |
+ 11.29% |
+ 14/124 |
@@ -90,7 +90,7 @@
diff --git a/coverage/server/api/users/index.js.html b/coverage/server/api/users/index.js.html
index a412eea..7a92dde 100644
--- a/coverage/server/api/users/index.js.html
+++ b/coverage/server/api/users/index.js.html
@@ -62,21 +62,21 @@
17
18
-8x
-8x
-8x
+2x
+2x
+2x
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
-8x
-8x
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
+2x
+2x
| 'use strict'
const router = require('koa-router')()
@@ -100,7 +100,7 @@
diff --git a/coverage/server/api/users/user.controller.js.html b/coverage/server/api/users/user.controller.js.html
index db06a79..6b57f80 100644
--- a/coverage/server/api/users/user.controller.js.html
+++ b/coverage/server/api/users/user.controller.js.html
@@ -20,28 +20,28 @@
- 91.94%
+ 11.29%
Statements
- 114/124
+ 14/124
- 89.04%
+ 0%
Branches
- 65/73
+ 0/73
- 94.44%
+ 50%
Functions
- 17/18
+ 9/18
- 91.94%
+ 11.29%
Lines
- 114/124
+ 14/124
-
+
1
2
@@ -244,200 +244,200 @@
199
200 |
-8x
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
+2x
-24x
+6x
-25x
-1x
-1x
-1x
-1x
-1x
+6x
+
+
+
+
+
-26x
-2x
-2x
-2x
+6x
+
+
+
-2x
-2x
-2x
-1x
+
+
+
+
-2x
-2x
-2x
-2x
-2x
+
+
+
+
+
-30x
-6x
-6x
-6x
6x
+
+
+
+
-6x
-1x
-5x
-3x
-2x
+
+
+
+
+
-2x
+
-6x
-4x
-4x
+
+
+
-2x
-2x
-2x
-2x
-1x
+
+
+
+
+
-1x
-1x
+
+
-1x
+
-27x
-3x
+6x
+
-3x
-1x
-1x
+
+
+
-2x
-2x
-1x
+
+
+
-1x
-1x
+
+
-1x
+
-31x
+6x
-7x
-7x
-7x
-7x
-7x
+
+
+
+
+
-7x
-1x
-6x
-1x
-5x
+
+
+
+
+
-1x
-4x
-1x
+
+
+
-7x
-4x
-4x
+
+
+
-3x
-3x
-3x
-3x
-3x
-3x
+
+
+
+
+
+
-3x
-1x
+
+
-3x
-2x
+
+
-2x
-2x
+
+
-1x
+
-28x
-4x
-4x
+6x
+
+
-4x
-1x
-3x
+
+
+
-1x
+
-4x
-2x
-2x
+
+
+
-2x
-2x
-2x
-2x
-1x
-1x
+
+
+
+
+
+
-1x
+
-25x
-1x
-1x
-1x
-1x
+6x
+
+
+
+
-25x
-1x
-1x
-1x
+6x
+
+
+
@@ -458,185 +458,185 @@
ctx.body = buffer
}
-exports.getMe = async (ctx,next)=>{
- const userId = ctx.req.user._id
- try{
- const user = await User.findById(userId)
- ctx.status = 200
- ctx.body = user.userInfo
+exports.getMe = async (ctx,next)=>{
+ const userId = ctx.req.user._id
+ try{
+ const user = await User.findById(userId)
+ ctx.status = 200
+ ctx.body = user.userInfo
}catch(err){
ctx.throw(err)
}
}
//后台获取用户列表
-exports.getUserList = async (ctx,next)=>{
- let currentPage = (parseInt(ctx.query.currentPage) > 0)?parseInt(ctx.query.currentPage):1
- let itemsPerPage = (parseInt(ctx.query.itemsPerPage) > 0)?parseInt(ctx.query.itemsPerPage):10
- let startRow = (currentPage - 1) * itemsPerPage
+exports.getUserList = async (ctx,next)=>{
+ let currentPage = (parseInt(ctx.query.currentPage) > 0)?parseInt(ctx.query.currentPage):1
+ let itemsPerPage = (parseInt(ctx.query.itemsPerPage) > 0)?parseInt(ctx.query.itemsPerPage):10
+ let startRow = (currentPage - 1) * itemsPerPage
- let sortName = String(ctx.query.sortName) || 'created'
- let sortOrder = ctx.query.sortOrder
- if(sortOrder === 'false'){
- sortName = '-' + sortName
+ let sortName = String(ctx.query.sortName) || 'created'
+ let sortOrder = ctx.query.sortOrder
+ if(sortOrder === 'false'){
+ sortName = '-' + sortName
}
- try{
- const count = await User.count()
- const userList = await User.find({}).skip(startRow).limit(itemsPerPage).sort(sortName).exec()
- ctx.status = 200
- ctx.body = { data: userList, count:count }
+ try{
+ const count = await User.count()
+ const userList = await User.find({}).skip(startRow).limit(itemsPerPage).sort(sortName).exec()
+ ctx.status = 200
+ ctx.body = { data: userList, count:count }
}catch(err){
ctx.throw(err)
}
}
//添加用户
-exports.addUser = async (ctx,next)=>{
- const nickname = ctx.request.body.nickname?ctx.request.body.nickname.replace(/(^\s+)|(\s+$)/g, ''):''
- const email = ctx.request.body.email?ctx.request.body.email.replace(/(^\s+)|(\s+$)/g, ''):''
- const NICKNAME_REGEXP = /^[(\u4e00-\u9fa5)0-9a-zA-Z\_\s@]+$/
- const EMAIL_REGEXP = /^(\w)+(\.\w+)*@(\w)+((\.\w+)+)$/
+exports.addUser = async (ctx,next)=>{
+ const nickname = ctx.request.body.nickname?ctx.request.body.nickname.replace(/(^\s+)|(\s+$)/g, ''):''
+ const email = ctx.request.body.email?ctx.request.body.email.replace(/(^\s+)|(\s+$)/g, ''):''
+ const NICKNAME_REGEXP = /^[(\u4e00-\u9fa5)0-9a-zA-Z\_\s@]+$/
+ const EMAIL_REGEXP = /^(\w)+(\.\w+)*@(\w)+((\.\w+)+)$/
let error_msg
- if(nickname === ''){
- error_msg = '呢称不能为空'
- }else if(email === ''){
- error_msg = '邮箱地址不能为空'
- }else Iif(nickname.length <= 2 || nickname.length >15 || !NICKNAME_REGEXP.test(nickname)){
+ if(nickname === ''){
+ error_msg = '呢称不能为空'
+ }else if(email === ''){
+ error_msg = '邮箱地址不能为空'
+ }else if(nickname.length <= 2 || nickname.length >15 || !NICKNAME_REGEXP.test(nickname)){
//不符合呢称规定.
error_msg = '呢称不合法'
- }else Iif(email.length <=4 || email.length > 30 || !EMAIL_REGEXP.test(email)){
+ }else if(email.length <=4 || email.length > 30 || !EMAIL_REGEXP.test(email)){
error_msg = '邮箱地址不合法'
}
- if(error_msg){
- ctx.status = 422
- return ctx.body = {error_msg:error_msg}
+ if(error_msg){
+ ctx.status = 422
+ return ctx.body = {error_msg:error_msg}
}
- try{
- let newUser = new User(ctx.request.body)
- newUser.role = 'user'
- const user = await newUser.save()
- await Logs.create({
+ try{
+ let newUser = new User(ctx.request.body)
+ newUser.role = 'user'
+ const user = await newUser.save()
+ await Logs.create({
uid: ctx.req.user._id,
- content:'创建新用户 '+ (user.email || user.nickname),
+ content:'创建新用户 '+ (user.email || user.nickname),
type:'user'
})
- ctx.status = 200
- ctx.body = {success:true,user_id:user._id}
+ ctx.status = 200
+ ctx.body = {success:true,user_id:user._id}
}catch(err){
- ctx.throw(err)
+ ctx.throw(err)
}
}
//删除用户
-exports.destroy = async (ctx,next)=>{
- const userId = ctx.req.user._id
+exports.destroy = async (ctx,next)=>{
+ const userId = ctx.req.user._id
- if(String(userId) === String(ctx.params.id)){
- ctx.status = 403
- return ctx.body = {message:'不能删除自己已经登录的账号'}
+ if(String(userId) === String(ctx.params.id)){
+ ctx.status = 403
+ return ctx.body = {message:'不能删除自己已经登录的账号'}
}else{
- try{
- const user = await User.findByIdAndRemove(ctx.params.id)
- await Logs.create({
+ try{
+ const user = await User.findByIdAndRemove(ctx.params.id)
+ await Logs.create({
uid:userId,
- content:'删除用户'+ (user.email || user.nickname),
+ content:'删除用户'+ (user.email || user.nickname),
type:'user'
})
- ctx.status = 200
- ctx.body = {success:true}
+ ctx.status = 200
+ ctx.body = {success:true}
}catch(err){
- ctx.throw(err)
+ ctx.throw(err)
}
}
}
//更新用户
-exports.updateUser = async (ctx,next)=>{
+exports.updateUser = async (ctx,next)=>{
//被编辑人
- const editUserId = ctx.params.id
- const nickname = ctx.request.body.nickname?ctx.request.body.nickname.replace(/(^\s+)|(\s+$)/g, ''):''
- const email = ctx.request.body.email?ctx.request.body.email.replace(/(^\s+)|(\s+$)/g, ''):''
- const NICKNAME_REGEXP = /^[(\u4e00-\u9fa5)0-9a-zA-Z\_\s@]+$/
- const EMAIL_REGEXP = /^(\w)+(\.\w+)*@(\w)+((\.\w+)+)$/
+ const editUserId = ctx.params.id
+ const nickname = ctx.request.body.nickname?ctx.request.body.nickname.replace(/(^\s+)|(\s+$)/g, ''):''
+ const email = ctx.request.body.email?ctx.request.body.email.replace(/(^\s+)|(\s+$)/g, ''):''
+ const NICKNAME_REGEXP = /^[(\u4e00-\u9fa5)0-9a-zA-Z\_\s@]+$/
+ const EMAIL_REGEXP = /^(\w)+(\.\w+)*@(\w)+((\.\w+)+)$/
let error_msg
- if(nickname === ''){
- error_msg = '呢称不能为空'
- }else if(email === ''){
- error_msg = '邮箱地址不能为空'
- }else if(nickname.length <= 2 || nickname.length >15 || !NICKNAME_REGEXP.test(nickname)){
+ if(nickname === ''){
+ error_msg = '呢称不能为空'
+ }else if(email === ''){
+ error_msg = '邮箱地址不能为空'
+ }else if(nickname.length <= 2 || nickname.length >15 || !NICKNAME_REGEXP.test(nickname)){
//不符合呢称规定.
- error_msg = '呢称不合法'
- }else if(email.length <=4 || email.length > 30 || !EMAIL_REGEXP.test(email)){
- error_msg = '邮箱地址不合法'
+ error_msg = '呢称不合法'
+ }else if(email.length <=4 || email.length > 30 || !EMAIL_REGEXP.test(email)){
+ error_msg = '邮箱地址不合法'
}
- if(error_msg){
- ctx.status = 422
- return ctx.body = {error_msg:error_msg}
+ if(error_msg){
+ ctx.status = 422
+ return ctx.body = {error_msg:error_msg}
}
- try{
- let user = await User.findById(editUserId)
- user.nickname = ctx.request.body.nickname
- user.email = ctx.request.body.email.toLowerCase()
- Eif(ctx.request.body.status){
- user.status = ctx.request.body.status
+ try{
+ let user = await User.findById(editUserId)
+ user.nickname = ctx.request.body.nickname
+ user.email = ctx.request.body.email.toLowerCase()
+ if(ctx.request.body.status){
+ user.status = ctx.request.body.status
}
- if(ctx.request.body.newPassword){
- user.password = ctx.request.body.newPassword
+ if(ctx.request.body.newPassword){
+ user.password = ctx.request.body.newPassword
}
- const newUser = await user.save()
- await Logs.create({
+ const newUser = await user.save()
+ await Logs.create({
email:ctx.req.user._id,
- content:'编辑用户'+ (newUser.email || newUser.nickname),
+ content:'编辑用户'+ (newUser.email || newUser.nickname),
type:'user'
})
- ctx.status = 200
- ctx.body = {success:true,user_id:newUser._id}
+ ctx.status = 200
+ ctx.body = {success:true,user_id:newUser._id}
}catch(err){
- ctx.throw(err)
+ ctx.throw(err)
}
}
//前台用户更新自己信息
-exports.mdUser = async (ctx,next)=>{
- const nickname = ctx.request.body.nickname?ctx.request.body.nickname.replace(/(^\s+)|(\s+$)/g, ''):''
- const NICKNAME_REGEXP = /^[(\u4e00-\u9fa5)0-9a-zA-Z\_\s@]+$/
+exports.mdUser = async (ctx,next)=>{
+ const nickname = ctx.request.body.nickname?ctx.request.body.nickname.replace(/(^\s+)|(\s+$)/g, ''):''
+ const NICKNAME_REGEXP = /^[(\u4e00-\u9fa5)0-9a-zA-Z\_\s@]+$/
//var EMAIL_REGEXP = /^(\w)+(\.\w+)*@(\w)+((\.\w+)+)$/
//检测一下
let error_msg
- if(nickname === ''){
- error_msg = '呢称不能为空'
- }else if(nickname.length <= 2 || nickname.length >15 || !NICKNAME_REGEXP.test(nickname)){
+ if(nickname === ''){
+ error_msg = '呢称不能为空'
+ }else if(nickname.length <= 2 || nickname.length >15 || !NICKNAME_REGEXP.test(nickname)){
//不符合呢称规定.
- error_msg = '呢称不合法'
+ error_msg = '呢称不合法'
}
- if(error_msg){
- ctx.status = 422
- return ctx.body = {error_msg:error_msg}
+ if(error_msg){
+ ctx.status = 422
+ return ctx.body = {error_msg:error_msg}
}
- let user = ctx.req.user
- user.nickname = nickname
- try{
- const result = await user.save()
- ctx.status = 200
- ctx.body = {success:true,data:result.userInfo}
+ let user = ctx.req.user
+ user.nickname = nickname
+ try{
+ const result = await user.save()
+ ctx.status = 200
+ ctx.body = {success:true,data:result.userInfo}
}catch(err){
- ctx.throw(err)
+ ctx.throw(err)
}
}
//前台获取用户社交账号绑定情况.
-exports.getUserProvider = async (ctx,next)=>{
- try{
- const user = await User.findById(ctx.req.user._id)
- ctx.status = 200
- ctx.body = {data:user.providerInfo}
+exports.getUserProvider = async (ctx,next)=>{
+ try{
+ const user = await User.findById(ctx.req.user._id)
+ ctx.status = 200
+ ctx.body = {data:user.providerInfo}
}catch(err){
ctx.throw(err)
}
}
//获取第三方登录列表.
-exports.getSnsLogins = async (ctx,next)=>{
- Eif(config.snsLogins){
- ctx.status = 200
- ctx.body = {success:true,data:config.snsLogins}
+exports.getSnsLogins = async (ctx,next)=>{
+ if(config.snsLogins){
+ ctx.status = 200
+ ctx.body = {success:true,data:config.snsLogins}
}else{
ctx.throw(404)
}
@@ -646,7 +646,7 @@
diff --git a/coverage/server/app.js.html b/coverage/server/app.js.html
index 15005eb..7c31b36 100644
--- a/coverage/server/app.js.html
+++ b/coverage/server/app.js.html
@@ -20,28 +20,28 @@
- 85%
+ 70%
Statements
- 17/20
+ 14/20
- 50%
+ 33.33%
Branches
- 3/6
+ 2/6
- 100%
+ 33.33%
Functions
- 3/3
+ 1/3
- 85%
+ 70%
Lines
- 17/20
+ 14/20
-
+
1
2
@@ -80,38 +80,38 @@
35 |
-8x
-8x
-8x
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
+2x
+2x
+2x
-8x
+2x
-117x
-93x
-93x
+6x
+
+
-8x
-8x
-8x
+2x
+2x
+2x
-8x
-10x
+2x
+
-8x | 'use strict'
+2x | 'use strict'
// 设置默认环境变量
process.env.NODE_ENV = process.env.NODE_ENV || 'development'
@@ -130,17 +130,17 @@
//log记录
//router use : this.logger.error('msg')
-app.use(async (ctx, next) => {
- ctx.logger = logger
- await next()
+app.use(async (ctx, next) => {
+ ctx.logger = logger
+ await next()
})
//错误处理中间件
app.use(errorHandleMiddle())
require('./config/koa')(app)
require('./routes')(app)
//错误监听
-app.on('error',(err,ctx)=>{
- Iif (process.env.NODE_ENV != 'test') {
+app.on('error',(err,ctx)=>{
+ if (process.env.NODE_ENV != 'test') {
console.error('error', err)
}
})
@@ -151,7 +151,7 @@
diff --git a/coverage/server/auth/auth.service.js.html b/coverage/server/auth/auth.service.js.html
index 6bfd739..9a0842f 100644
--- a/coverage/server/auth/auth.service.js.html
+++ b/coverage/server/auth/auth.service.js.html
@@ -20,24 +20,24 @@
- 77.5%
+ 50%
Statements
- 31/40
+ 20/40
- 43.75%
+ 6.25%
Branches
- 7/16
+ 1/16
- 92.86%
+ 57.14%
Functions
- 13/14
+ 8/14
- 81.82%
+ 48.48%
Lines
- 27/33
+ 16/33
@@ -134,24 +134,24 @@
89
90 |
-8x
-8x
-8x
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
+2x
+2x
+2x
-567x
+124x
-71x
+
-71x
+
@@ -160,17 +160,17 @@
-1038x
+224x
-71x
-71x
+
+
-71x
-71x
-71x
-71x
+
+
+
+
@@ -179,12 +179,12 @@
-176x
-410x
+44x
+88x
-58x
-58x
+
+
@@ -196,14 +196,14 @@
-6x
+
-48x
+12x
@@ -217,10 +217,10 @@
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
| 'use strict'
const mongoose = require('mongoose')
@@ -236,11 +236,11 @@
*/
function authToken() {
return compose([
- async (ctx,next)=> {
- Iif(ctx.query && ctx.query.access_token){
+ async (ctx,next)=> {
+ if(ctx.query && ctx.query.access_token){
ctx.headers.authorization = 'Bearer ' + ctx.query.access_token
}
- await next()
+ await next()
},
koajwt({ secret: config.session.secrets,passthrough: true })
])
@@ -251,15 +251,15 @@
function isAuthenticated() {
return compose([
authToken(),
- async (ctx,next) =>{
- Iif(!ctx.state.user) ctx.throw('UnauthorizedError',401)
- await next()
+ async (ctx,next) =>{
+ if(!ctx.state.user) ctx.throw('UnauthorizedError',401)
+ await next()
},
- async (ctx,next) =>{
- var user = await User.findById(ctx.state.user._id)
- Iif (!user) ctx.throw('UnauthorizedError',401)
- ctx.req.user = user
- await next()
+ async (ctx,next) =>{
+ var user = await User.findById(ctx.state.user._id)
+ if (!user) ctx.throw('UnauthorizedError',401)
+ ctx.req.user = user
+ await next()
}
])
}
@@ -271,9 +271,9 @@
Iif (!roleRequired) this.throw('Required role needs to be set')
return compose([
isAuthenticated(),
- async (ctx,next) =>{
- Eif (config.userRoles.indexOf(ctx.req.user.role) >= config.userRoles.indexOf(roleRequired)) {
- await next()
+ async (ctx,next) =>{
+ if (config.userRoles.indexOf(ctx.req.user.role) >= config.userRoles.indexOf(roleRequired)) {
+ await next()
}else {
ctx.throw(403)
}
@@ -284,8 +284,8 @@
/**
* 生成token
*/
-function signToken(id) {
- return jwt.sign({ _id: id }, config.session.secrets, { expiresIn: config.session.cookie.maxAge/1000 })
+function signToken(id) {
+ return jwt.sign({ _id: id }, config.session.secrets, { expiresIn: config.session.cookie.maxAge/1000 })
}
/**
@@ -316,7 +316,7 @@
diff --git a/coverage/server/auth/github/index.html b/coverage/server/auth/github/index.html
index bcc8f1d..83945aa 100644
--- a/coverage/server/auth/github/index.html
+++ b/coverage/server/auth/github/index.html
@@ -90,7 +90,7 @@
diff --git a/coverage/server/auth/github/index.js.html b/coverage/server/auth/github/index.js.html
index bbb902d..1ea3b1b 100644
--- a/coverage/server/auth/github/index.js.html
+++ b/coverage/server/auth/github/index.js.html
@@ -81,15 +81,15 @@
36
37 |
-8x
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
+2x
-24x
+6x
@@ -114,7 +114,7 @@
-8x
+2x
| 'use strict'
const router = require('koa-router')()
@@ -157,7 +157,7 @@
diff --git a/coverage/server/auth/github/passport.js.html b/coverage/server/auth/github/passport.js.html
index 8baac60..3ccd37e 100644
--- a/coverage/server/auth/github/passport.js.html
+++ b/coverage/server/auth/github/passport.js.html
@@ -87,13 +87,13 @@
42
43 |
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
-8x
-16x
+2x
+4x
@@ -175,7 +175,7 @@
diff --git a/coverage/server/auth/index.html b/coverage/server/auth/index.html
index b375900..65185b5 100644
--- a/coverage/server/auth/index.html
+++ b/coverage/server/auth/index.html
@@ -20,28 +20,28 @@
- 83.64%
+ 63.64%
Statements
- 46/55
+ 35/55
- 43.75%
+ 6.25%
Branches
- 7/16
+ 1/16
- 92.86%
+ 57.14%
Functions
- 13/14
+ 8/14
- 87.5%
+ 64.58%
Lines
- 42/48
+ 31/48
-
+
@@ -60,15 +60,15 @@
auth.service.js |
- |
- 77.5% |
- 31/40 |
- 43.75% |
- 7/16 |
- 92.86% |
- 13/14 |
- 81.82% |
- 27/33 |
+ |
+ 50% |
+ 20/40 |
+ 6.25% |
+ 1/16 |
+ 57.14% |
+ 8/14 |
+ 48.48% |
+ 16/33 |
@@ -90,7 +90,7 @@
diff --git a/coverage/server/auth/index.js.html b/coverage/server/auth/index.js.html
index 22e1092..e212338 100644
--- a/coverage/server/auth/index.js.html
+++ b/coverage/server/auth/index.js.html
@@ -65,25 +65,25 @@
20
21
-8x
-8x
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
+2x
+2x
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
-8x | 'use strict'
+2x | 'use strict'
const router = require('koa-router')()
const passport = require('koa-passport')
@@ -109,7 +109,7 @@
diff --git a/coverage/server/auth/local/index.html b/coverage/server/auth/local/index.html
index d916d44..a597a04 100644
--- a/coverage/server/auth/local/index.html
+++ b/coverage/server/auth/local/index.html
@@ -20,28 +20,28 @@
- 78.43%
+ 27.45%
Statements
- 40/51
+ 14/51
- 53.85%
+ 0%
Branches
- 14/26
+ 0/26
- 100%
+ 50%
Functions
- 10/10
+ 5/10
- 79.17%
+ 27.08%
Lines
- 38/48
+ 13/48
-
+
@@ -59,29 +59,29 @@
- index.js |
- |
- 67.86% |
- 19/28 |
- 33.33% |
- 6/18 |
- 100% |
- 7/7 |
- 69.23% |
- 18/26 |
+ index.js |
+ |
+ 28.57% |
+ 8/28 |
+ 0% |
+ 0/18 |
+ 42.86% |
+ 3/7 |
+ 30.77% |
+ 8/26 |
- passport.js |
- |
- 91.3% |
- 21/23 |
- 100% |
- 8/8 |
- 100% |
- 3/3 |
- 90.91% |
- 20/22 |
+ passport.js |
+ |
+ 26.09% |
+ 6/23 |
+ 0% |
+ 0/8 |
+ 66.67% |
+ 2/3 |
+ 22.73% |
+ 5/22 |
@@ -90,7 +90,7 @@
diff --git a/coverage/server/auth/local/index.js.html b/coverage/server/auth/local/index.js.html
index 93a1788..c149ef0 100644
--- a/coverage/server/auth/local/index.js.html
+++ b/coverage/server/auth/local/index.js.html
@@ -20,28 +20,28 @@
- 67.86%
+ 28.57%
Statements
- 19/28
+ 8/28
- 33.33%
+ 0%
Branches
- 6/18
+ 0/18
- 100%
+ 42.86%
Functions
- 7/7
+ 3/7
- 69.23%
+ 30.77%
Lines
- 18/26
+ 8/26
-
+
1
2
@@ -87,17 +87,17 @@
42
43 |
-8x
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
+2x
-34x
+6x
-10x
+
@@ -106,27 +106,27 @@
-10x
+
-10x
-
+
-34x
-30x
-10x
-10x
-4x
-4x
6x
-6x
+
+
+
+
+
+
+
+
-8x
+2x
| 'use strict'
const mongoose = require('mongoose')
@@ -136,10 +136,10 @@
const auth = require('../auth.service')
function checkCaptcha() {
- return async (ctx, next) => {
+ return async (ctx, next) => {
//测试环境不用验证码
let error_msg
- Iif(process.env.NODE_ENV !== 'test' && !ctx.req.headers.jackblog){
+ if(process.env.NODE_ENV !== 'test' && !ctx.req.headers.jackblog){
if(!ctx.request.body.captcha){
error_msg = '验证码不能为空.'
}else if(ctx.session.captcha !== ctx.request.body.captcha.toLowerCase()){
@@ -148,23 +148,23 @@
error_msg = '用户名和密码不能为空.'
}
}
- Iif(error_msg){
+ if(error_msg){
ctx.status = 422
return ctx.body = {error_msg:error_msg}
}
- await next()
+ await next()
}
}
-router.post('/', checkCaptcha(), async (ctx,next) =>{
- await passport.authenticate('local', async (err, user, info)=> {
- Iif (err) ctx.throw(err)
- if(info){
- ctx.status = 403
- return ctx.body = info
+router.post('/', checkCaptcha(), async (ctx,next) =>{
+ await passport.authenticate('local', async (err, user, info)=> {
+ if (err) ctx.throw(err)
+ if(info){
+ ctx.status = 403
+ return ctx.body = info
}
- const token = auth.signToken(user._id)
- ctx.body = {token: token}
+ const token = auth.signToken(user._id)
+ ctx.body = {token: token}
})(ctx, next)
})
@@ -175,7 +175,7 @@
diff --git a/coverage/server/auth/local/passport.js.html b/coverage/server/auth/local/passport.js.html
index ea79344..4894c45 100644
--- a/coverage/server/auth/local/passport.js.html
+++ b/coverage/server/auth/local/passport.js.html
@@ -20,28 +20,28 @@
- 91.3%
+ 26.09%
Statements
- 21/23
+ 6/23
- 100%
+ 0%
Branches
- 8/8
+ 0/8
- 100%
+ 66.67%
Functions
- 3/3
+ 2/3
- 90.91%
+ 22.73%
Lines
- 20/22
+ 5/22
-
+
1
2
@@ -82,35 +82,35 @@
37
38 |
-8x
-8x
-8x
+2x
+2x
+2x
-8x
-26x
+2x
+4x
-10x
-10x
-10x
-1x
-1x
+
+
+
+
+
-9x
-1x
-1x
+
+
+
-8x
-1x
-1x
+
+
+
-7x
-1x
-1x
+
+
+
-6x
+
@@ -128,26 +128,26 @@
usernameField: 'email',
passwordField: 'password' // this is the virtual field on the model
},
- async (email, password, done) => {
- try {
- const user = await User.findOne({email: email.toLowerCase()})
- if (!user) {
- logger.error('登录用户名错误',{'username':email})
- return done(null, false, { error_msg: '用户名或密码错误.' })
+ async (email, password, done) => {
+ try {
+ const user = await User.findOne({email: email.toLowerCase()})
+ if (!user) {
+ logger.error('登录用户名错误',{'username':email})
+ return done(null, false, { error_msg: '用户名或密码错误.' })
}
- if (!user.authenticate(password)) {
- logger.error('登录密码错误',{'username':email})
- return done(null, false, { error_msg: '用户名或密码错误.' })
+ if (!user.authenticate(password)) {
+ logger.error('登录密码错误',{'username':email})
+ return done(null, false, { error_msg: '用户名或密码错误.' })
}
- if(user.status === 2){
- logger.error('被阻止登录', {'username':email})
- return done(null, false, { error_msg: '用户被阻止登录.' })
+ if(user.status === 2){
+ logger.error('被阻止登录', {'username':email})
+ return done(null, false, { error_msg: '用户被阻止登录.' })
}
- if(user.status === 0){
- logger.error('未验证用户登录',{'username':email})
- return done(null, false, { error_msg: '用户未验证.' })
+ if(user.status === 0){
+ logger.error('未验证用户登录',{'username':email})
+ return done(null, false, { error_msg: '用户未验证.' })
}
- return done(null, user)
+ return done(null, user)
} catch (err) {
logger.debug('LocalStrategy error')
return done(err)
@@ -160,7 +160,7 @@
diff --git a/coverage/server/auth/qq/index.html b/coverage/server/auth/qq/index.html
index c7097d3..d39e3d8 100644
--- a/coverage/server/auth/qq/index.html
+++ b/coverage/server/auth/qq/index.html
@@ -90,7 +90,7 @@
diff --git a/coverage/server/auth/qq/index.js.html b/coverage/server/auth/qq/index.js.html
index 4ade2c3..528da97 100644
--- a/coverage/server/auth/qq/index.js.html
+++ b/coverage/server/auth/qq/index.js.html
@@ -82,15 +82,15 @@
37
38 |
-8x
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
+2x
-24x
+6x
@@ -116,7 +116,7 @@
-8x
+2x
| 'use strict'
const router = require('koa-router')()
@@ -160,7 +160,7 @@
diff --git a/coverage/server/auth/qq/passport.js.html b/coverage/server/auth/qq/passport.js.html
index a59178e..62caed1 100644
--- a/coverage/server/auth/qq/passport.js.html
+++ b/coverage/server/auth/qq/passport.js.html
@@ -91,13 +91,13 @@
46
47 |
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
-8x
-16x
+2x
+4x
@@ -187,7 +187,7 @@
diff --git a/coverage/server/auth/weibo/index.html b/coverage/server/auth/weibo/index.html
index 0cc8d17..0b466cf 100644
--- a/coverage/server/auth/weibo/index.html
+++ b/coverage/server/auth/weibo/index.html
@@ -90,7 +90,7 @@
diff --git a/coverage/server/auth/weibo/index.js.html b/coverage/server/auth/weibo/index.js.html
index a5d503c..4f25b7d 100644
--- a/coverage/server/auth/weibo/index.js.html
+++ b/coverage/server/auth/weibo/index.js.html
@@ -82,15 +82,15 @@
37
38 |
-8x
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
+2x
-24x
+6x
@@ -116,7 +116,7 @@
-8x
+2x
| 'use strict'
const router = require('koa-router')()
@@ -160,7 +160,7 @@
diff --git a/coverage/server/auth/weibo/passport.js.html b/coverage/server/auth/weibo/passport.js.html
index cb323a6..e1a61d4 100644
--- a/coverage/server/auth/weibo/passport.js.html
+++ b/coverage/server/auth/weibo/passport.js.html
@@ -86,13 +86,13 @@
41
42 |
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
-8x
-16x
+2x
+4x
@@ -172,7 +172,7 @@
diff --git a/coverage/server/config/env/index.html b/coverage/server/config/env/index.html
index c7ca1ad..41316e6 100644
--- a/coverage/server/config/env/index.html
+++ b/coverage/server/config/env/index.html
@@ -25,9 +25,9 @@
9/9
- 93.75%
+ 93.18%
Branches
- 45/48
+ 41/44
100%
@@ -63,8 +63,8 @@
|
100% |
8/8 |
- 93.48% |
- 43/46 |
+ 92.86% |
+ 39/42 |
100% |
0/0 |
100% |
@@ -90,7 +90,7 @@
diff --git a/coverage/server/config/env/index.js.html b/coverage/server/config/env/index.js.html
index 5951e84..4f3fa67 100644
--- a/coverage/server/config/env/index.js.html
+++ b/coverage/server/config/env/index.js.html
@@ -25,9 +25,9 @@
8/8
- 93.48%
+ 92.86%
Branches
- 43/46
+ 39/42
100%
@@ -132,11 +132,11 @@
87
88 |
-8x
-8x
-8x
+2x
+2x
+2x
-8x
+2x
@@ -211,12 +211,12 @@
-8x
+2x
-8x
-8x
+2x
+2x
-8x
+2x
| 'use strict'
var path = require('path')
@@ -231,8 +231,8 @@
mongo: {
options: {
useMongoClient: true,
- user: process.env.MONGO_USERNAME || '',
- pass: process.env.MONGO_PASSWORD || ''
+ // user: process.env.MONGO_USERNAME || '',
+ // pass: process.env.MONGO_PASSWORD || ''
}
},
//redis 配置
@@ -310,7 +310,7 @@
diff --git a/coverage/server/config/env/test.js.html b/coverage/server/config/env/test.js.html
index ec28be8..4939e1e 100644
--- a/coverage/server/config/env/test.js.html
+++ b/coverage/server/config/env/test.js.html
@@ -64,7 +64,7 @@
-8x
+2x
@@ -83,7 +83,7 @@
// ===========================
module.exports = {
mongo: {
- uri: 'mongodb://localhost/jackblog-test'
+ uri: `mongodb://${null}:${null}@localhost:27017/jackblog-test`
},
redis: {
db: 2,
@@ -100,7 +100,7 @@
diff --git a/coverage/server/config/index.html b/coverage/server/config/index.html
index de74ebb..2bcbfed 100644
--- a/coverage/server/config/index.html
+++ b/coverage/server/config/index.html
@@ -77,7 +77,7 @@
diff --git a/coverage/server/config/koa.js.html b/coverage/server/config/koa.js.html
index e05d3e2..228906f 100644
--- a/coverage/server/config/koa.js.html
+++ b/coverage/server/config/koa.js.html
@@ -82,30 +82,30 @@
37
38 |
-8x
-8x
-8x
-8x
-8x
-8x
-8x
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
+2x
+2x
+2x
+2x
+2x
+2x
+2x
-8x
-8x
+2x
+2x
-8x
+2x
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
@@ -114,8 +114,8 @@
-8x
-8x
+2x
+2x
| 'use strict'
@@ -160,7 +160,7 @@
diff --git a/coverage/server/connect.js.html b/coverage/server/connect.js.html
index 9275f88..06b96c4 100644
--- a/coverage/server/connect.js.html
+++ b/coverage/server/connect.js.html
@@ -59,23 +59,23 @@
14
15
16
-17 | 8x
-8x
-8x
-8x
+17 | 2x
+2x
+2x
+2x
-8x
-8x
-8x
-48x
-48x
+2x
+2x
+2x
+12x
+12x
-8x
+2x
-8x | const path = require('path')
+2x | const path = require('path')
const fs = require('fs')
const mongoose = require('mongoose')
const config = require('./config/env')
@@ -97,7 +97,7 @@
diff --git a/coverage/server/index.html b/coverage/server/index.html
index a2dafe2..d371a6d 100644
--- a/coverage/server/index.html
+++ b/coverage/server/index.html
@@ -20,24 +20,24 @@
- 92%
+ 86%
Statements
- 46/50
+ 43/50
- 50%
+ 37.5%
Branches
- 4/8
+ 3/8
- 83.33%
+ 50%
Functions
- 5/6
+ 3/6
- 92%
+ 86%
Lines
- 46/50
+ 43/50
@@ -59,16 +59,16 @@
|
- app.js |
- |
- 85% |
- 17/20 |
- 50% |
- 3/6 |
- 100% |
- 3/3 |
- 85% |
- 17/20 |
+ app.js |
+ |
+ 70% |
+ 14/20 |
+ 33.33% |
+ 2/6 |
+ 33.33% |
+ 1/3 |
+ 70% |
+ 14/20 |
@@ -103,7 +103,7 @@
diff --git a/coverage/server/model/article.model.js.html b/coverage/server/model/article.model.js.html
index 3ba21d9..6501936 100644
--- a/coverage/server/model/article.model.js.html
+++ b/coverage/server/model/article.model.js.html
@@ -20,9 +20,9 @@
- 100%
+ 85.71%
Statements
- 7/7
+ 6/7
100%
@@ -30,14 +30,14 @@
0/0
- 100%
+ 0%
Functions
- 1/1
+ 0/1
- 100%
+ 85.71%
Lines
- 7/7
+ 6/7
@@ -125,10 +125,10 @@
-8x
-8x
+2x
+2x
-8x
+2x
@@ -181,10 +181,10 @@
-8x
+2x
-1x
+
@@ -196,8 +196,8 @@
-8x
-8x/**
+2x
+2x | /**
* 文章表
*/
'use strict'
@@ -260,8 +260,8 @@
ArticleSchema
.virtual('info')
- .get(function() {
- return {
+ .get(function() {
+ return {
'_id': this._id,
'title': this.title,
'content': this.content,
@@ -280,7 +280,7 @@
diff --git a/coverage/server/model/comment.model.js.html b/coverage/server/model/comment.model.js.html
index 724dcfa..045bd43 100644
--- a/coverage/server/model/comment.model.js.html
+++ b/coverage/server/model/comment.model.js.html
@@ -87,10 +87,10 @@
-8x
-8x
+2x
+2x
-8x
+2x
@@ -120,8 +120,8 @@
-8x
-8x | /**
+2x
+2x | /**
* 评论表
*/
'use strict'
@@ -166,7 +166,7 @@
diff --git a/coverage/server/model/index.html b/coverage/server/model/index.html
index f0869da..25a4358 100644
--- a/coverage/server/model/index.html
+++ b/coverage/server/model/index.html
@@ -20,28 +20,28 @@
- 90.63%
+ 60.94%
Statements
- 58/64
+ 39/64
- 66.67%
+ 0%
Branches
- 8/12
+ 0/12
- 75%
+ 0%
Functions
- 9/12
+ 0/12
- 93.44%
+ 63.93%
Lines
- 57/61
+ 39/61
-
+
@@ -60,15 +60,15 @@
article.model.js |
- |
- 100% |
- 7/7 |
+ |
+ 85.71% |
+ 6/7 |
100% |
0/0 |
- 100% |
- 1/1 |
- 100% |
- 7/7 |
+ 0% |
+ 0/1 |
+ 85.71% |
+ 6/7 |
@@ -124,16 +124,16 @@
- user.model.js |
- |
- 83.78% |
- 31/37 |
- 66.67% |
- 8/12 |
- 72.73% |
- 8/11 |
- 88.24% |
- 30/34 |
+ user.model.js |
+ |
+ 35.14% |
+ 13/37 |
+ 0% |
+ 0/12 |
+ 0% |
+ 0/11 |
+ 38.24% |
+ 13/34 |
@@ -142,7 +142,7 @@
diff --git a/coverage/server/model/logs.model.js.html b/coverage/server/model/logs.model.js.html
index b2b9aac..d1a6674 100644
--- a/coverage/server/model/logs.model.js.html
+++ b/coverage/server/model/logs.model.js.html
@@ -67,10 +67,10 @@
22
23
-8x
-8x
+2x
+2x
-8x
+2x
@@ -86,8 +86,8 @@
-8x
-8x | 'use strict'
+2x
+2x | 'use strict'
const mongoose = require('mongoose')
const Schema = mongoose.Schema
@@ -115,7 +115,7 @@
diff --git a/coverage/server/model/tag.category.model.js.html b/coverage/server/model/tag.category.model.js.html
index 2a7de2e..99ff788 100644
--- a/coverage/server/model/tag.category.model.js.html
+++ b/coverage/server/model/tag.category.model.js.html
@@ -65,10 +65,10 @@
-8x
-8x
+2x
+2x
-8x
+2x
@@ -76,8 +76,8 @@
-8x
-8x | /**
+2x
+2x | /**
* 标签分类表,管理标签
*/
'use strict'
@@ -100,7 +100,7 @@
diff --git a/coverage/server/model/tag.model.js.html b/coverage/server/model/tag.model.js.html
index b9f178f..139a554 100644
--- a/coverage/server/model/tag.model.js.html
+++ b/coverage/server/model/tag.model.js.html
@@ -82,10 +82,10 @@
-8x
-8x
+2x
+2x
-8x
+2x
@@ -108,8 +108,8 @@
-8x
-8x | /**
+2x
+2x | /**
* 标签表
*/
@@ -148,7 +148,7 @@
diff --git a/coverage/server/model/user.model.js.html b/coverage/server/model/user.model.js.html
index 1dd2f43..9664f18 100644
--- a/coverage/server/model/user.model.js.html
+++ b/coverage/server/model/user.model.js.html
@@ -20,28 +20,28 @@
- 83.78%
+ 35.14%
Statements
- 31/37
+ 13/37
- 66.67%
+ 0%
Branches
- 8/12
+ 0/12
- 72.73%
+ 0%
Functions
- 8/11
+ 0/11
- 88.24%
+ 38.24%
Lines
- 30/34
+ 13/34
-
+
1
2
@@ -224,11 +224,11 @@
-8x
-8x
-8x
+2x
+2x
+2x
-8x
+2x
@@ -305,22 +305,22 @@
-8x
+2x
-11x
-11x
-11x
+
+
+
-8x
+2x
-2x
+
@@ -330,10 +330,10 @@
-8x
+2x
-1x
+
@@ -344,7 +344,7 @@
-8x
+2x
@@ -353,23 +353,23 @@
-8x
+2x
-15x
-15x
-15x
-15x
-4x
-3x
+
+
+
+
+
+
-11x
+
-8x
+2x
@@ -377,24 +377,24 @@
-9x
+
-11x
+
-20x
-20x
-20x
+
+
+
-8x
+2x
-8x
-8x
+2x
+2x
| /**
* 用户表
*/
@@ -483,10 +483,10 @@
*/
UserSchema
.virtual('password')
- .set(function(password) {
- this._password = password
- this.salt = this.makeSalt()
- this.hashedPassword = this.encryptPassword(password)
+ .set(function(password) {
+ this._password = password
+ this.salt = this.makeSalt()
+ this.hashedPassword = this.encryptPassword(password)
})
.get(function() {
return this._password
@@ -495,8 +495,8 @@
UserSchema
.virtual('userInfo')
- .get(function() {
- return {
+ .get(function() {
+ return {
'nickname': this.nickname,
'role': this.role,
'email': this.email,
@@ -508,8 +508,8 @@
UserSchema
.virtual('providerInfo')
- .get(function() {
- return {
+ .get(function() {
+ return {
'qq': this.qq,
'github': this.github,
'weibo': this.weibo,
@@ -531,15 +531,15 @@
UserSchema
.path('nickname')
- .validate(function(value, respond) {
- var self = this
- this.constructor.findOne({nickname: value}, function(err, user) {
- Iif(err) throw err
- if(user) {
- if(self.id === user.id) return respond(true)
- return respond(false)
+ .validate(function(value, respond) {
+ var self = this
+ this.constructor.findOne({nickname: value}, function(err, user) {
+ if(err) throw err
+ if(user) {
+ if(self.id === user.id) return respond(true)
+ return respond(false)
}
- respond(true)
+ respond(true)
})
}, '这个呢称已经被使用.')
/**
@@ -552,18 +552,18 @@
return (selfRoles.indexOf('admin') !== -1 || selfRoles.indexOf(role) !== -1)
},
//验证用户密码
- authenticate: function(plainText) {
- return this.encryptPassword(plainText) === this.hashedPassword
+ authenticate: function(plainText) {
+ return this.encryptPassword(plainText) === this.hashedPassword
},
//生成盐
- makeSalt: function() {
- return crypto.randomBytes(16).toString('base64')
+ makeSalt: function() {
+ return crypto.randomBytes(16).toString('base64')
},
//生成密码
- encryptPassword: function(password) {
- Iif (!password || !this.salt) return ''
- var salt = new Buffer(this.salt, 'base64')
- return crypto.pbkdf2Sync(password, salt, 10000, 64, 'sha1').toString('base64')
+ encryptPassword: function(password) {
+ if (!password || !this.salt) return ''
+ var salt = new Buffer(this.salt, 'base64')
+ return crypto.pbkdf2Sync(password, salt, 10000, 64, 'sha1').toString('base64')
}
}
@@ -577,7 +577,7 @@
diff --git a/coverage/server/routes.js.html b/coverage/server/routes.js.html
index 9341923..8ebb5d4 100644
--- a/coverage/server/routes.js.html
+++ b/coverage/server/routes.js.html
@@ -65,27 +65,27 @@
20
21
22
-23 | 8x
-8x
-8x
-8x
-8x
-8x
-8x
-8x
+23 | 2x
+2x
+2x
+2x
+2x
+2x
+2x
+2x
-8x
-8x
-8x
-8x
-8x
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
+2x
+2x
+2x
+2x
+2x
-8x
+2x
| const Router = require('koa-router')()
const logs = require('./api/logs')
@@ -115,7 +115,7 @@
diff --git a/coverage/server/util/debug/index.html b/coverage/server/util/debug/index.html
index 80512fe..68402bb 100644
--- a/coverage/server/util/debug/index.html
+++ b/coverage/server/util/debug/index.html
@@ -77,7 +77,7 @@
diff --git a/coverage/server/util/debug/index.js.html b/coverage/server/util/debug/index.js.html
index fb3a671..1e402e4 100644
--- a/coverage/server/util/debug/index.js.html
+++ b/coverage/server/util/debug/index.js.html
@@ -51,10 +51,10 @@
6
7 |
-8x
+2x
-8x
-48x
+2x
+12x
| 'use strict'
const pkg = require('../../../package.json')
@@ -67,7 +67,7 @@
diff --git a/coverage/server/util/error/index.html b/coverage/server/util/error/index.html
index 2c749b6..8338860 100644
--- a/coverage/server/util/error/index.html
+++ b/coverage/server/util/error/index.html
@@ -20,28 +20,28 @@
- 100%
+ 28.57%
Statements
- 14/14
+ 4/14
- 75%
+ 0%
Branches
- 6/8
+ 0/8
- 100%
+ 50%
Functions
- 4/4
+ 2/4
- 100%
+ 28.57%
Lines
- 14/14
+ 4/14
-
+
@@ -59,16 +59,16 @@
- index.js |
- |
- 100% |
- 14/14 |
- 75% |
- 6/8 |
- 100% |
- 4/4 |
- 100% |
- 14/14 |
+ index.js |
+ |
+ 28.57% |
+ 4/14 |
+ 0% |
+ 0/8 |
+ 50% |
+ 2/4 |
+ 28.57% |
+ 4/14 |
@@ -77,7 +77,7 @@
diff --git a/coverage/server/util/error/index.js.html b/coverage/server/util/error/index.js.html
index 8b03d4c..a9122ed 100644
--- a/coverage/server/util/error/index.js.html
+++ b/coverage/server/util/error/index.js.html
@@ -20,28 +20,28 @@
- 100%
+ 28.57%
Statements
- 14/14
+ 4/14
- 75%
+ 0%
Branches
- 6/8
+ 0/8
- 100%
+ 50%
Functions
- 4/4
+ 2/4
- 100%
+ 28.57%
Lines
- 14/14
+ 4/14
-
+
1
2
@@ -65,46 +65,46 @@
20
21
22
-23 | 8x
+23 | 2x
-8x
-117x
-93x
-93x
+2x
+6x
+
+
-10x
-10x
-10x
-3x
-3x
-3x
+
+
+
+
+
+
-10x
-10x
+
+
-8x | const _ = require('lodash')
+2x | const _ = require('lodash')
const errorHandleMiddle = function () {
- return async (ctx, next) => {
- try {
- await next()
+ return async (ctx, next) => {
+ try {
+ await next()
} catch (err) {
- ctx.status = err.status || 500
- let error_msg = err.message
- if(err.errors && typeof(err.errors) === 'object'){
- _.mapValues(err.errors, (item)=>{
- Eif(item.message){
- error_msg = item.message
+ ctx.status = err.status || 500
+ let error_msg = err.message
+ if(err.errors && typeof(err.errors) === 'object'){
+ _.mapValues(err.errors, (item)=>{
+ if(item.message){
+ error_msg = item.message
}
})
}
- ctx.body = {error_msg: error_msg}
- ctx.app.emit('error', err, ctx)
+ ctx.body = {error_msg: error_msg}
+ ctx.app.emit('error', err, ctx)
}
}
}
@@ -115,7 +115,7 @@
diff --git a/coverage/server/util/logs/index.html b/coverage/server/util/logs/index.html
index 6016c9f..7a660f9 100644
--- a/coverage/server/util/logs/index.html
+++ b/coverage/server/util/logs/index.html
@@ -77,7 +77,7 @@
diff --git a/coverage/server/util/logs/index.js.html b/coverage/server/util/logs/index.js.html
index cf69383..0967037 100644
--- a/coverage/server/util/logs/index.js.html
+++ b/coverage/server/util/logs/index.js.html
@@ -81,11 +81,11 @@
36
37 |
-8x
-8x
-8x
+2x
+2x
+2x
-8x
+2x
@@ -114,7 +114,7 @@
-8x
+2x
| 'use strict'
const path = require('path')
@@ -157,7 +157,7 @@
diff --git a/coverage/server/util/qiniu/index.html b/coverage/server/util/qiniu/index.html
index 4e89338..544a02c 100644
--- a/coverage/server/util/qiniu/index.html
+++ b/coverage/server/util/qiniu/index.html
@@ -20,28 +20,28 @@
- 100%
+ 58.82%
Statements
- 51/51
+ 30/51
- 100%
+ 0%
Branches
- 2/2
+ 0/2
- 100%
+ 0%
Functions
- 13/13
+ 0/13
- 100%
+ 58.82%
Lines
- 51/51
+ 30/51
-
+
@@ -59,16 +59,16 @@
- index.js |
- |
- 100% |
- 51/51 |
- 100% |
- 2/2 |
- 100% |
- 13/13 |
- 100% |
- 51/51 |
+ index.js |
+ |
+ 58.82% |
+ 30/51 |
+ 0% |
+ 0/2 |
+ 0% |
+ 0/13 |
+ 58.82% |
+ 30/51 |
@@ -77,7 +77,7 @@
diff --git a/coverage/server/util/qiniu/index.js.html b/coverage/server/util/qiniu/index.js.html
index 168d4ab..e1c8096 100644
--- a/coverage/server/util/qiniu/index.js.html
+++ b/coverage/server/util/qiniu/index.js.html
@@ -20,28 +20,28 @@
- 100%
+ 58.82%
Statements
- 51/51
+ 30/51
- 100%
+ 0%
Branches
- 2/2
+ 0/2
- 100%
+ 0%
Functions
- 13/13
+ 0/13
- 100%
+ 58.82%
Lines
- 51/51
+ 30/51
-
+
1
2
@@ -133,79 +133,79 @@
88
89 |
-8x
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
+2x
-8x
-8x
-8x
+2x
+2x
+2x
-8x
-8x
-8x
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
+2x
+2x
+2x
-8x
-8x
-8x
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
+2x
+2x
+2x
-1x
-1x
+
+
-8x
-8x
+2x
+2x
-8x
-1x
-1x
-1x
+2x
+
+
+
-8x
-1x
-1x
-1x
-1x
-1x
+2x
+
+
+
+
+
-8x
+2x
-1x
-1x
-1x
+
+
+
-8x
+2x
-1x
-1x
-1x
+
+
+
-8x
-1x
-1x
+2x
+
+
@@ -214,10 +214,10 @@
-8x
-1x
-1x
-1x
+2x
+
+
+
| 'use strict'
@@ -249,51 +249,51 @@
exports.allList = allList
//获取上传凭证
-function getUptoken(bucketname) {
- var putPolicy = new qiniu.rs.PutPolicy(bucketname)
- return putPolicy.token()
+function getUptoken(bucketname) {
+ var putPolicy = new qiniu.rs.PutPolicy(bucketname)
+ return putPolicy.token()
}
//不同空间可以相互操作,在这里只在一个空间下操作
var bucket = config.qiniu.bucket
exports.bucket = bucket
//将网络图片上传到七牛服务器
-exports.fetch = function (url,key) {
- return this.fetchFile(url,bucket,key).then(function (result) {
- result.url = config.qiniu.domain + result.key
- return result
+exports.fetch = function (url,key) {
+ return this.fetchFile(url,bucket,key).then(function (result) {
+ result.url = config.qiniu.domain + result.key
+ return result
})
}
//上传文件
-exports.upload = function (path,key) {
- var extra = new qiniu.io.PutExtra()
- var uptoken = getUptoken(config.qiniu.bucket)
- return this.uploadFile(uptoken, key, path, extra).then(function(result){
- result.url = config.qiniu.domain + result.key
- return result
+exports.upload = function (path,key) {
+ var extra = new qiniu.io.PutExtra()
+ var uptoken = getUptoken(config.qiniu.bucket)
+ return this.uploadFile(uptoken, key, path, extra).then(function(result){
+ result.url = config.qiniu.domain + result.key
+ return result
})
}
//将源空间的指定资源移动到目标空间,或在同一空间内对资源重命名。
-exports.move = function(keySrc,keyDest){
+exports.move = function(keySrc,keyDest){
var bucketSrc,bucketDest
- bucketSrc = bucketDest = bucket
- return this.moveFile(bucketSrc, keySrc, bucketDest, keyDest).then(function (result) {
- return result
+ bucketSrc = bucketDest = bucket
+ return this.moveFile(bucketSrc, keySrc, bucketDest, keyDest).then(function (result) {
+ return result
})
}
//复制文件
-exports.copy = function(keySrc,keyDest){
+exports.copy = function(keySrc,keyDest){
var bucketSrc,bucketDest
- bucketSrc = bucketDest = bucket
- return this.copyFile(bucketSrc, keySrc, bucketDest, keyDest).then(function (result) {
- return result
+ bucketSrc = bucketDest = bucket
+ return this.copyFile(bucketSrc, keySrc, bucketDest, keyDest).then(function (result) {
+ return result
})
}
-exports.remove = function(key){
- return this.removeFile(bucket,key).then(function (result) {
- return result
+exports.remove = function(key){
+ return this.removeFile(bucket,key).then(function (result) {
+ return result
})
}
/*
@@ -302,10 +302,10 @@
marker 上一次列举返回的位置标记,作为本次列举的起点信息。缺省值为空字符串
delimiter 指定目录分隔符,列出所有公共前缀(模拟列出目录效果)。默认值为空字符串。
*/
-exports.list = function(prefix, marker, limit, delimiter){
- var delimiter = delimiter || ''
- return this.allList(bucket, prefix, marker, limit, delimiter).then(function(result){
- return result
+exports.list = function(prefix, marker, limit, delimiter){
+ var delimiter = delimiter || ''
+ return this.allList(bucket, prefix, marker, limit, delimiter).then(function(result){
+ return result
})
} |
@@ -313,7 +313,7 @@
diff --git a/coverage/server/util/redis/index.html b/coverage/server/util/redis/index.html
index 5752ef8..f31bd9c 100644
--- a/coverage/server/util/redis/index.html
+++ b/coverage/server/util/redis/index.html
@@ -77,7 +77,7 @@
diff --git a/coverage/server/util/redis/index.js.html b/coverage/server/util/redis/index.js.html
index 0e27a99..b696ac0 100644
--- a/coverage/server/util/redis/index.js.html
+++ b/coverage/server/util/redis/index.js.html
@@ -58,18 +58,18 @@
13
14
-8x
-8x
-8x
-8x
+2x
+2x
+2x
+2x
-8x
+2x
-8x
+2x
-8x | 'use strict'
+2x | 'use strict'
const _ = require('lodash')
const Redis = require('ioredis')
@@ -88,7 +88,7 @@
diff --git a/coverage/server/util/tools/index.html b/coverage/server/util/tools/index.html
index f7826d1..2ec361f 100644
--- a/coverage/server/util/tools/index.html
+++ b/coverage/server/util/tools/index.html
@@ -20,28 +20,28 @@
- 100%
+ 15.79%
Statements
- 19/19
+ 3/19
- 80%
+ 0%
Branches
- 8/10
+ 0/10
- 100%
+ 0%
Functions
- 3/3
+ 0/3
- 100%
+ 15.79%
Lines
- 19/19
+ 3/19
-
+
@@ -59,16 +59,16 @@
- index.js |
- |
- 100% |
- 19/19 |
- 80% |
- 8/10 |
- 100% |
- 3/3 |
- 100% |
- 19/19 |
+ index.js |
+ |
+ 15.79% |
+ 3/19 |
+ 0% |
+ 0/10 |
+ 0% |
+ 0/3 |
+ 15.79% |
+ 3/19 |
@@ -77,7 +77,7 @@
diff --git a/coverage/server/util/tools/index.js.html b/coverage/server/util/tools/index.js.html
index 597835b..7e92cfe 100644
--- a/coverage/server/util/tools/index.js.html
+++ b/coverage/server/util/tools/index.js.html
@@ -20,28 +20,28 @@
- 100%
+ 15.79%
Statements
- 19/19
+ 3/19
- 80%
+ 0%
Branches
- 8/10
+ 0/10
- 100%
+ 0%
Functions
- 3/3
+ 0/3
- 100%
+ 15.79%
Lines
- 19/19
+ 3/19
-
+
1
2
@@ -75,63 +75,63 @@
30
31 |
-9x
+3x
-9x
-2x
-2x
-2x
-2x
-2x
-18x
+3x
+
+
+
+
+
+
-2x
+
-9x
-5x
-5x
-5x
-4x
-4x
-4x
+3x
+
+
+
+
+
+
-4x
-4x
+
+
-5x
+
| "use strict"
const _ = require('lodash')
//生成随机字符串
-exports.randomString = function (len) {
- len = len || 12
- const $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678' /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
- const maxPos = $chars.length
- let pwd = ''
- for (let i = 0; i < len; i++) {
- pwd += $chars.charAt(Math.floor(Math.random() * maxPos))
+exports.randomString = function (len) {
+ len = len || 12
+ const $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678' /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
+ const maxPos = $chars.length
+ let pwd = ''
+ for (let i = 0; i < len; i++) {
+ pwd += $chars.charAt(Math.floor(Math.random() * maxPos))
}
- return pwd
+ return pwd
}
//从markdown中提取图片
-exports.extractImage = function (content) {
- let results = []
- const images = content.match(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g)
- if(_.isArray(images) && images.length > 0){
- for(let i = 0,j = images.length;i<j;i++){
- var url = images[i].replace(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/,function ($1,m1,m2,m3,m4) {
- return m4 || ''
+exports.extractImage = function (content) {
+ let results = []
+ const images = content.match(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g)
+ if(_.isArray(images) && images.length > 0){
+ for(let i = 0,j = images.length;i<j;i++){
+ var url = images[i].replace(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/,function ($1,m1,m2,m3,m4) {
+ return m4 || ''
})
- Eif(url !== ''){
- results.push({url:url})
+ if(url !== ''){
+ results.push({url:url})
}
}
}
- return results
+ return results
}
|
@@ -139,7 +139,7 @@
diff --git a/logs/production-error.log.0 b/logs/production-error.log.0
new file mode 100644
index 0000000..e69de29
diff --git a/logs/test-error.log.0 b/logs/test-error.log.0
index d67988f..41a9da7 100644
--- a/logs/test-error.log.0
+++ b/logs/test-error.log.0
@@ -1,8 +1,4 @@
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":24415,"level":50,"msg":"登录密码错误 { username: 'test011499766253597@tets.com' }","time":"2017-07-11T09:44:31.958Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":24415,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-07-11T09:44:31.982Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":24415,"level":50,"msg":"未验证用户登录 { username: 'test021499766253597@tets.com' }","time":"2017-07-11T09:44:32.032Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":24415,"level":50,"msg":"被阻止登录 { username: 'test031499766253597@tets.com' }","time":"2017-07-11T09:44:32.084Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":28165,"level":50,"msg":"登录密码错误 { username: 'test011499770200186@tets.com' }","time":"2017-07-11T10:50:10.957Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":28165,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-07-11T10:50:10.980Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":28165,"level":50,"msg":"未验证用户登录 { username: 'test021499770200186@tets.com' }","time":"2017-07-11T10:50:11.038Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":28165,"level":50,"msg":"被阻止登录 { username: 'test031499770200186@tets.com' }","time":"2017-07-11T10:50:11.093Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":33341,"level":50,"msg":"登录密码错误 { username: 'test011499850069777@tets.com' }","time":"2017-07-12T09:01:39.811Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":33341,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-07-12T09:01:39.838Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":33341,"level":50,"msg":"未验证用户登录 { username: 'test021499850069777@tets.com' }","time":"2017-07-12T09:01:39.897Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":33341,"level":50,"msg":"被阻止登录 { username: 'test031499850069777@tets.com' }","time":"2017-07-12T09:01:39.971Z","v":0}
diff --git a/logs/test-error.log.1 b/logs/test-error.log.1
index ce8d230..d67988f 100644
--- a/logs/test-error.log.1
+++ b/logs/test-error.log.1
@@ -1,12 +1,8 @@
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":9986,"level":50,"msg":"登录密码错误 { username: 'test011499655931026@tets.com' }","time":"2017-07-10T03:05:40.464Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":9986,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-07-10T03:05:40.487Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":9986,"level":50,"msg":"未验证用户登录 { username: 'test021499655931027@tets.com' }","time":"2017-07-10T03:05:40.542Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":9986,"level":50,"msg":"被阻止登录 { username: 'test031499655931027@tets.com' }","time":"2017-07-10T03:05:40.600Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":11114,"level":50,"msg":"登录密码错误 { username: 'test011499657034522@tets.com' }","time":"2017-07-10T03:24:03.768Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":11114,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-07-10T03:24:03.792Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":11114,"level":50,"msg":"未验证用户登录 { username: 'test021499657034522@tets.com' }","time":"2017-07-10T03:24:03.846Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":11114,"level":50,"msg":"被阻止登录 { username: 'test031499657034522@tets.com' }","time":"2017-07-10T03:24:03.899Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":11592,"level":50,"msg":"登录密码错误 { username: 'test011499657360204@tets.com' }","time":"2017-07-10T03:29:30.506Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":11592,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-07-10T03:29:30.529Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":11592,"level":50,"msg":"未验证用户登录 { username: 'test021499657360204@tets.com' }","time":"2017-07-10T03:29:30.587Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":11592,"level":50,"msg":"被阻止登录 { username: 'test031499657360204@tets.com' }","time":"2017-07-10T03:29:30.637Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":24415,"level":50,"msg":"登录密码错误 { username: 'test011499766253597@tets.com' }","time":"2017-07-11T09:44:31.958Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":24415,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-07-11T09:44:31.982Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":24415,"level":50,"msg":"未验证用户登录 { username: 'test021499766253597@tets.com' }","time":"2017-07-11T09:44:32.032Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":24415,"level":50,"msg":"被阻止登录 { username: 'test031499766253597@tets.com' }","time":"2017-07-11T09:44:32.084Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":28165,"level":50,"msg":"登录密码错误 { username: 'test011499770200186@tets.com' }","time":"2017-07-11T10:50:10.957Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":28165,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-07-11T10:50:10.980Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":28165,"level":50,"msg":"未验证用户登录 { username: 'test021499770200186@tets.com' }","time":"2017-07-11T10:50:11.038Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":28165,"level":50,"msg":"被阻止登录 { username: 'test031499770200186@tets.com' }","time":"2017-07-11T10:50:11.093Z","v":0}
diff --git a/logs/test-error.log.2 b/logs/test-error.log.2
index 4eb111a..ce8d230 100644
--- a/logs/test-error.log.2
+++ b/logs/test-error.log.2
@@ -1,24 +1,12 @@
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62467,"level":50,"msg":"登录密码错误 { username: 'test011495354154466@tets.com' }","time":"2017-05-21T08:09:23.413Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62467,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-21T08:09:23.436Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62467,"level":50,"msg":"未验证用户登录 { username: 'test021495354154466@tets.com' }","time":"2017-05-21T08:09:23.494Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62467,"level":50,"msg":"被阻止登录 { username: 'test031495354154466@tets.com' }","time":"2017-05-21T08:09:23.553Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62815,"level":50,"msg":"登录密码错误 { username: 'test011495354357182@tets.com' }","time":"2017-05-21T08:12:50.188Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62815,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-21T08:12:50.214Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62815,"level":50,"msg":"未验证用户登录 { username: 'test021495354357182@tets.com' }","time":"2017-05-21T08:12:50.270Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62815,"level":50,"msg":"被阻止登录 { username: 'test031495354357182@tets.com' }","time":"2017-05-21T08:12:50.332Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62931,"level":50,"msg":"登录密码错误 { username: 'test011495354411139@tets.com' }","time":"2017-05-21T08:13:48.790Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62931,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-21T08:13:48.832Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62931,"level":50,"msg":"未验证用户登录 { username: 'test021495354411139@tets.com' }","time":"2017-05-21T08:13:48.903Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62931,"level":50,"msg":"被阻止登录 { username: 'test031495354411139@tets.com' }","time":"2017-05-21T08:13:48.983Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":66009,"level":50,"msg":"登录密码错误 { username: 'test011495356424433@tets.com' }","time":"2017-05-21T08:47:15.944Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":66009,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-21T08:47:15.970Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":66009,"level":50,"msg":"未验证用户登录 { username: 'test021495356424433@tets.com' }","time":"2017-05-21T08:47:16.040Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":66009,"level":50,"msg":"被阻止登录 { username: 'test031495356424433@tets.com' }","time":"2017-05-21T08:47:16.098Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":67168,"level":50,"msg":"登录密码错误 { username: 'test011495357248958@tets.com' }","time":"2017-05-21T09:00:59.330Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":67168,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-21T09:00:59.352Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":67168,"level":50,"msg":"未验证用户登录 { username: 'test021495357248958@tets.com' }","time":"2017-05-21T09:00:59.431Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":67168,"level":50,"msg":"被阻止登录 { username: 'test031495357248958@tets.com' }","time":"2017-05-21T09:00:59.487Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":67417,"level":50,"msg":"登录密码错误 { username: 'test011495357436866@tets.com' }","time":"2017-05-21T09:04:07.099Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":67417,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-21T09:04:07.119Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":67417,"level":50,"msg":"未验证用户登录 { username: 'test021495357436866@tets.com' }","time":"2017-05-21T09:04:07.166Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":67417,"level":50,"msg":"被阻止登录 { username: 'test031495357436866@tets.com' }","time":"2017-05-21T09:04:07.232Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":9986,"level":50,"msg":"登录密码错误 { username: 'test011499655931026@tets.com' }","time":"2017-07-10T03:05:40.464Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":9986,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-07-10T03:05:40.487Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":9986,"level":50,"msg":"未验证用户登录 { username: 'test021499655931027@tets.com' }","time":"2017-07-10T03:05:40.542Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":9986,"level":50,"msg":"被阻止登录 { username: 'test031499655931027@tets.com' }","time":"2017-07-10T03:05:40.600Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":11114,"level":50,"msg":"登录密码错误 { username: 'test011499657034522@tets.com' }","time":"2017-07-10T03:24:03.768Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":11114,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-07-10T03:24:03.792Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":11114,"level":50,"msg":"未验证用户登录 { username: 'test021499657034522@tets.com' }","time":"2017-07-10T03:24:03.846Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":11114,"level":50,"msg":"被阻止登录 { username: 'test031499657034522@tets.com' }","time":"2017-07-10T03:24:03.899Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":11592,"level":50,"msg":"登录密码错误 { username: 'test011499657360204@tets.com' }","time":"2017-07-10T03:29:30.506Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":11592,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-07-10T03:29:30.529Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":11592,"level":50,"msg":"未验证用户登录 { username: 'test021499657360204@tets.com' }","time":"2017-07-10T03:29:30.587Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":11592,"level":50,"msg":"被阻止登录 { username: 'test031499657360204@tets.com' }","time":"2017-07-10T03:29:30.637Z","v":0}
diff --git a/logs/test-error.log.3 b/logs/test-error.log.3
index 065f4b4..4eb111a 100644
--- a/logs/test-error.log.3
+++ b/logs/test-error.log.3
@@ -1,36 +1,24 @@
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":27482,"level":50,"msg":"登录密码错误 { username: 'test011493716797472@tets.com' }","time":"2017-05-02T09:20:04.338Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":27482,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-02T09:20:04.491Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":27482,"level":50,"msg":"未验证用户登录 { username: 'test021493716797472@tets.com' }","time":"2017-05-02T09:20:04.717Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":27482,"level":50,"msg":"被阻止登录 { username: 'test031493716797472@tets.com' }","time":"2017-05-02T09:20:04.946Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":28034,"level":50,"msg":"登录密码错误 { username: 'test011493717239796@tets.com' }","time":"2017-05-02T09:27:25.905Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":28034,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-02T09:27:25.934Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":28034,"level":50,"msg":"未验证用户登录 { username: 'test021493717239796@tets.com' }","time":"2017-05-02T09:27:26.005Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":28034,"level":50,"msg":"被阻止登录 { username: 'test031493717239796@tets.com' }","time":"2017-05-02T09:27:26.063Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29060,"level":50,"msg":"登录密码错误 { username: 'test011493718010690@tets.com' }","time":"2017-05-02T09:40:16.381Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29060,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-02T09:40:16.434Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29060,"level":50,"msg":"未验证用户登录 { username: 'test021493718010690@tets.com' }","time":"2017-05-02T09:40:16.514Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29060,"level":50,"msg":"被阻止登录 { username: 'test031493718010690@tets.com' }","time":"2017-05-02T09:40:16.598Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29203,"level":50,"msg":"登录密码错误 { username: 'test011493718135453@tets.com' }","time":"2017-05-02T09:42:21.988Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29203,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-02T09:42:22.014Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29203,"level":50,"msg":"未验证用户登录 { username: 'test021493718135453@tets.com' }","time":"2017-05-02T09:42:22.094Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29203,"level":50,"msg":"被阻止登录 { username: 'test031493718135453@tets.com' }","time":"2017-05-02T09:42:22.158Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29374,"level":50,"msg":"登录密码错误 { username: 'test011493718264152@tets.com' }","time":"2017-05-02T09:44:29.614Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29374,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-02T09:44:29.666Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29374,"level":50,"msg":"未验证用户登录 { username: 'test021493718264152@tets.com' }","time":"2017-05-02T09:44:29.757Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29374,"level":50,"msg":"被阻止登录 { username: 'test031493718264152@tets.com' }","time":"2017-05-02T09:44:29.838Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29449,"level":50,"msg":"登录密码错误 { username: 'test011493718324275@tets.com' }","time":"2017-05-02T09:45:29.233Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29449,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-02T09:45:29.265Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29449,"level":50,"msg":"未验证用户登录 { username: 'test021493718324275@tets.com' }","time":"2017-05-02T09:45:29.338Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29449,"level":50,"msg":"被阻止登录 { username: 'test031493718324275@tets.com' }","time":"2017-05-02T09:45:29.399Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29556,"level":50,"msg":"登录密码错误 { username: 'test011493718403340@tets.com' }","time":"2017-05-02T09:46:48.959Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29556,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-02T09:46:49.012Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29556,"level":50,"msg":"未验证用户登录 { username: 'test021493718403341@tets.com' }","time":"2017-05-02T09:46:49.110Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29556,"level":50,"msg":"被阻止登录 { username: 'test031493718403341@tets.com' }","time":"2017-05-02T09:46:49.184Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":30099,"level":50,"msg":"登录密码错误 { username: 'test011493718835648@tets.com' }","time":"2017-05-02T09:54:01.475Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":30099,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-02T09:54:01.556Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":30099,"level":50,"msg":"未验证用户登录 { username: 'test021493718835648@tets.com' }","time":"2017-05-02T09:54:01.624Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":30099,"level":50,"msg":"被阻止登录 { username: 'test031493718835648@tets.com' }","time":"2017-05-02T09:54:01.698Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":30211,"level":50,"msg":"登录密码错误 { username: 'test011493718900389@tets.com' }","time":"2017-05-02T09:55:06.189Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":30211,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-02T09:55:06.378Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":30211,"level":50,"msg":"未验证用户登录 { username: 'test021493718900390@tets.com' }","time":"2017-05-02T09:55:06.634Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":30211,"level":50,"msg":"被阻止登录 { username: 'test031493718900390@tets.com' }","time":"2017-05-02T09:55:06.842Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62467,"level":50,"msg":"登录密码错误 { username: 'test011495354154466@tets.com' }","time":"2017-05-21T08:09:23.413Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62467,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-21T08:09:23.436Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62467,"level":50,"msg":"未验证用户登录 { username: 'test021495354154466@tets.com' }","time":"2017-05-21T08:09:23.494Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62467,"level":50,"msg":"被阻止登录 { username: 'test031495354154466@tets.com' }","time":"2017-05-21T08:09:23.553Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62815,"level":50,"msg":"登录密码错误 { username: 'test011495354357182@tets.com' }","time":"2017-05-21T08:12:50.188Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62815,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-21T08:12:50.214Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62815,"level":50,"msg":"未验证用户登录 { username: 'test021495354357182@tets.com' }","time":"2017-05-21T08:12:50.270Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62815,"level":50,"msg":"被阻止登录 { username: 'test031495354357182@tets.com' }","time":"2017-05-21T08:12:50.332Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62931,"level":50,"msg":"登录密码错误 { username: 'test011495354411139@tets.com' }","time":"2017-05-21T08:13:48.790Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62931,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-21T08:13:48.832Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62931,"level":50,"msg":"未验证用户登录 { username: 'test021495354411139@tets.com' }","time":"2017-05-21T08:13:48.903Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":62931,"level":50,"msg":"被阻止登录 { username: 'test031495354411139@tets.com' }","time":"2017-05-21T08:13:48.983Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":66009,"level":50,"msg":"登录密码错误 { username: 'test011495356424433@tets.com' }","time":"2017-05-21T08:47:15.944Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":66009,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-21T08:47:15.970Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":66009,"level":50,"msg":"未验证用户登录 { username: 'test021495356424433@tets.com' }","time":"2017-05-21T08:47:16.040Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":66009,"level":50,"msg":"被阻止登录 { username: 'test031495356424433@tets.com' }","time":"2017-05-21T08:47:16.098Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":67168,"level":50,"msg":"登录密码错误 { username: 'test011495357248958@tets.com' }","time":"2017-05-21T09:00:59.330Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":67168,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-21T09:00:59.352Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":67168,"level":50,"msg":"未验证用户登录 { username: 'test021495357248958@tets.com' }","time":"2017-05-21T09:00:59.431Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":67168,"level":50,"msg":"被阻止登录 { username: 'test031495357248958@tets.com' }","time":"2017-05-21T09:00:59.487Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":67417,"level":50,"msg":"登录密码错误 { username: 'test011495357436866@tets.com' }","time":"2017-05-21T09:04:07.099Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":67417,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-21T09:04:07.119Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":67417,"level":50,"msg":"未验证用户登录 { username: 'test021495357436866@tets.com' }","time":"2017-05-21T09:04:07.166Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":67417,"level":50,"msg":"被阻止登录 { username: 'test031495357436866@tets.com' }","time":"2017-05-21T09:04:07.232Z","v":0}
diff --git a/logs/test-error.log.4 b/logs/test-error.log.4
index 45994cc..065f4b4 100644
--- a/logs/test-error.log.4
+++ b/logs/test-error.log.4
@@ -1,8 +1,36 @@
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":19209,"level":50,"msg":"登录密码错误 { username: 'test011488120311653@tets.com' }","time":"2017-02-26T14:45:23.895Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":19209,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-02-26T14:45:23.930Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":19209,"level":50,"msg":"未验证用户登录 { username: 'test021488120311653@tets.com' }","time":"2017-02-26T14:45:24.003Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":19209,"level":50,"msg":"被阻止登录 { username: 'test031488120311653@tets.com' }","time":"2017-02-26T14:45:24.063Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":19353,"level":50,"msg":"登录密码错误 { username: 'test011488120456866@tets.com' }","time":"2017-02-26T14:47:47.998Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":19353,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-02-26T14:47:48.038Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":19353,"level":50,"msg":"未验证用户登录 { username: 'test021488120456866@tets.com' }","time":"2017-02-26T14:47:48.133Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":19353,"level":50,"msg":"被阻止登录 { username: 'test031488120456866@tets.com' }","time":"2017-02-26T14:47:48.234Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":27482,"level":50,"msg":"登录密码错误 { username: 'test011493716797472@tets.com' }","time":"2017-05-02T09:20:04.338Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":27482,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-02T09:20:04.491Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":27482,"level":50,"msg":"未验证用户登录 { username: 'test021493716797472@tets.com' }","time":"2017-05-02T09:20:04.717Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":27482,"level":50,"msg":"被阻止登录 { username: 'test031493716797472@tets.com' }","time":"2017-05-02T09:20:04.946Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":28034,"level":50,"msg":"登录密码错误 { username: 'test011493717239796@tets.com' }","time":"2017-05-02T09:27:25.905Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":28034,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-02T09:27:25.934Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":28034,"level":50,"msg":"未验证用户登录 { username: 'test021493717239796@tets.com' }","time":"2017-05-02T09:27:26.005Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":28034,"level":50,"msg":"被阻止登录 { username: 'test031493717239796@tets.com' }","time":"2017-05-02T09:27:26.063Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29060,"level":50,"msg":"登录密码错误 { username: 'test011493718010690@tets.com' }","time":"2017-05-02T09:40:16.381Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29060,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-02T09:40:16.434Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29060,"level":50,"msg":"未验证用户登录 { username: 'test021493718010690@tets.com' }","time":"2017-05-02T09:40:16.514Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29060,"level":50,"msg":"被阻止登录 { username: 'test031493718010690@tets.com' }","time":"2017-05-02T09:40:16.598Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29203,"level":50,"msg":"登录密码错误 { username: 'test011493718135453@tets.com' }","time":"2017-05-02T09:42:21.988Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29203,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-02T09:42:22.014Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29203,"level":50,"msg":"未验证用户登录 { username: 'test021493718135453@tets.com' }","time":"2017-05-02T09:42:22.094Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29203,"level":50,"msg":"被阻止登录 { username: 'test031493718135453@tets.com' }","time":"2017-05-02T09:42:22.158Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29374,"level":50,"msg":"登录密码错误 { username: 'test011493718264152@tets.com' }","time":"2017-05-02T09:44:29.614Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29374,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-02T09:44:29.666Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29374,"level":50,"msg":"未验证用户登录 { username: 'test021493718264152@tets.com' }","time":"2017-05-02T09:44:29.757Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29374,"level":50,"msg":"被阻止登录 { username: 'test031493718264152@tets.com' }","time":"2017-05-02T09:44:29.838Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29449,"level":50,"msg":"登录密码错误 { username: 'test011493718324275@tets.com' }","time":"2017-05-02T09:45:29.233Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29449,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-02T09:45:29.265Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29449,"level":50,"msg":"未验证用户登录 { username: 'test021493718324275@tets.com' }","time":"2017-05-02T09:45:29.338Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29449,"level":50,"msg":"被阻止登录 { username: 'test031493718324275@tets.com' }","time":"2017-05-02T09:45:29.399Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29556,"level":50,"msg":"登录密码错误 { username: 'test011493718403340@tets.com' }","time":"2017-05-02T09:46:48.959Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29556,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-02T09:46:49.012Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29556,"level":50,"msg":"未验证用户登录 { username: 'test021493718403341@tets.com' }","time":"2017-05-02T09:46:49.110Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":29556,"level":50,"msg":"被阻止登录 { username: 'test031493718403341@tets.com' }","time":"2017-05-02T09:46:49.184Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":30099,"level":50,"msg":"登录密码错误 { username: 'test011493718835648@tets.com' }","time":"2017-05-02T09:54:01.475Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":30099,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-02T09:54:01.556Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":30099,"level":50,"msg":"未验证用户登录 { username: 'test021493718835648@tets.com' }","time":"2017-05-02T09:54:01.624Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":30099,"level":50,"msg":"被阻止登录 { username: 'test031493718835648@tets.com' }","time":"2017-05-02T09:54:01.698Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":30211,"level":50,"msg":"登录密码错误 { username: 'test011493718900389@tets.com' }","time":"2017-05-02T09:55:06.189Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":30211,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-05-02T09:55:06.378Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":30211,"level":50,"msg":"未验证用户登录 { username: 'test021493718900390@tets.com' }","time":"2017-05-02T09:55:06.634Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":30211,"level":50,"msg":"被阻止登录 { username: 'test031493718900390@tets.com' }","time":"2017-05-02T09:55:06.842Z","v":0}
diff --git a/logs/test-error.log.5 b/logs/test-error.log.5
index ce8adf1..45994cc 100644
--- a/logs/test-error.log.5
+++ b/logs/test-error.log.5
@@ -1,20 +1,8 @@
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":3480,"level":50,"msg":"登录密码错误 { username: 'test011483256390895@tets.com' }","time":"2017-01-01T07:39:57.532Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":3480,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-01-01T07:39:57.651Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":3480,"level":50,"msg":"未验证用户登录 { username: 'test021483256390896@tets.com' }","time":"2017-01-01T07:39:57.893Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":3480,"level":50,"msg":"被阻止登录 { username: 'test031483256390896@tets.com' }","time":"2017-01-01T07:39:58.107Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":4287,"level":50,"msg":"登录密码错误 { username: 'test011483256816653@tets.com' }","time":"2017-01-01T07:47:02.858Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":4287,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-01-01T07:47:02.991Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":4287,"level":50,"msg":"未验证用户登录 { username: 'test021483256816653@tets.com' }","time":"2017-01-01T07:47:03.215Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":4287,"level":50,"msg":"被阻止登录 { username: 'test031483256816653@tets.com' }","time":"2017-01-01T07:47:03.444Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":6180,"level":50,"msg":"登录密码错误 { username: 'test011483258772603@tets.com' }","time":"2017-01-01T08:19:39.025Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":6180,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-01-01T08:19:39.143Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":6180,"level":50,"msg":"未验证用户登录 { username: 'test021483258772603@tets.com' }","time":"2017-01-01T08:19:39.400Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":6180,"level":50,"msg":"被阻止登录 { username: 'test031483258772603@tets.com' }","time":"2017-01-01T08:19:39.667Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":6327,"level":50,"msg":"登录密码错误 { username: 'test011483258884201@tets.com' }","time":"2017-01-01T08:21:34.805Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":6327,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-01-01T08:21:34.838Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":6327,"level":50,"msg":"未验证用户登录 { username: 'test021483258884201@tets.com' }","time":"2017-01-01T08:21:34.914Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":6327,"level":50,"msg":"被阻止登录 { username: 'test031483258884201@tets.com' }","time":"2017-01-01T08:21:34.981Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":7049,"level":50,"msg":"登录密码错误 { username: 'test011483259781199@tets.com' }","time":"2017-01-01T08:36:39.591Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":7049,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-01-01T08:36:39.648Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":7049,"level":50,"msg":"未验证用户登录 { username: 'test021483259781199@tets.com' }","time":"2017-01-01T08:36:39.730Z","v":0}
-{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":7049,"level":50,"msg":"被阻止登录 { username: 'test031483259781199@tets.com' }","time":"2017-01-01T08:36:39.815Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":19209,"level":50,"msg":"登录密码错误 { username: 'test011488120311653@tets.com' }","time":"2017-02-26T14:45:23.895Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":19209,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-02-26T14:45:23.930Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":19209,"level":50,"msg":"未验证用户登录 { username: 'test021488120311653@tets.com' }","time":"2017-02-26T14:45:24.003Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":19209,"level":50,"msg":"被阻止登录 { username: 'test031488120311653@tets.com' }","time":"2017-02-26T14:45:24.063Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":19353,"level":50,"msg":"登录密码错误 { username: 'test011488120456866@tets.com' }","time":"2017-02-26T14:47:47.998Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":19353,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-02-26T14:47:48.038Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":19353,"level":50,"msg":"未验证用户登录 { username: 'test021488120456866@tets.com' }","time":"2017-02-26T14:47:48.133Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":19353,"level":50,"msg":"被阻止登录 { username: 'test031488120456866@tets.com' }","time":"2017-02-26T14:47:48.234Z","v":0}
diff --git a/logs/test-error.log.6 b/logs/test-error.log.6
index e69de29..ce8adf1 100644
--- a/logs/test-error.log.6
+++ b/logs/test-error.log.6
@@ -0,0 +1,20 @@
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":3480,"level":50,"msg":"登录密码错误 { username: 'test011483256390895@tets.com' }","time":"2017-01-01T07:39:57.532Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":3480,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-01-01T07:39:57.651Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":3480,"level":50,"msg":"未验证用户登录 { username: 'test021483256390896@tets.com' }","time":"2017-01-01T07:39:57.893Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":3480,"level":50,"msg":"被阻止登录 { username: 'test031483256390896@tets.com' }","time":"2017-01-01T07:39:58.107Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":4287,"level":50,"msg":"登录密码错误 { username: 'test011483256816653@tets.com' }","time":"2017-01-01T07:47:02.858Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":4287,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-01-01T07:47:02.991Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":4287,"level":50,"msg":"未验证用户登录 { username: 'test021483256816653@tets.com' }","time":"2017-01-01T07:47:03.215Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":4287,"level":50,"msg":"被阻止登录 { username: 'test031483256816653@tets.com' }","time":"2017-01-01T07:47:03.444Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":6180,"level":50,"msg":"登录密码错误 { username: 'test011483258772603@tets.com' }","time":"2017-01-01T08:19:39.025Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":6180,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-01-01T08:19:39.143Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":6180,"level":50,"msg":"未验证用户登录 { username: 'test021483258772603@tets.com' }","time":"2017-01-01T08:19:39.400Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":6180,"level":50,"msg":"被阻止登录 { username: 'test031483258772603@tets.com' }","time":"2017-01-01T08:19:39.667Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":6327,"level":50,"msg":"登录密码错误 { username: 'test011483258884201@tets.com' }","time":"2017-01-01T08:21:34.805Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":6327,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-01-01T08:21:34.838Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":6327,"level":50,"msg":"未验证用户登录 { username: 'test021483258884201@tets.com' }","time":"2017-01-01T08:21:34.914Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":6327,"level":50,"msg":"被阻止登录 { username: 'test031483258884201@tets.com' }","time":"2017-01-01T08:21:34.981Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":7049,"level":50,"msg":"登录密码错误 { username: 'test011483259781199@tets.com' }","time":"2017-01-01T08:36:39.591Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":7049,"level":50,"msg":"登录用户名错误 { username: 'ttttt@ttttt.com' }","time":"2017-01-01T08:36:39.648Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":7049,"level":50,"msg":"未验证用户登录 { username: 'test021483259781199@tets.com' }","time":"2017-01-01T08:36:39.730Z","v":0}
+{"name":"jackblog","hostname":"hugongzideMacBook-Air.local","pid":7049,"level":50,"msg":"被阻止登录 { username: 'test031483259781199@tets.com' }","time":"2017-01-01T08:36:39.815Z","v":0}
diff --git a/package-lock.json b/package-lock.json
index e340df9..ce7dbc6 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "jackblog-api-koa",
- "version": "2.3.2",
+ "version": "2.3.3",
"lockfileVersion": 1,
"dependencies": {
"@ava/babel-plugin-throws-helper": {
diff --git a/package.json b/package.json
index 002d757..5e400ef 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "jackblog-api-koa",
- "version": "2.3.2",
+ "version": "2.3.3",
"description": "jackblog API koa版",
"main": "server/app.js",
"scripts": {
diff --git a/server/config/env/development.js b/server/config/env/development.js
index b0ef21b..d92d366 100644
--- a/server/config/env/development.js
+++ b/server/config/env/development.js
@@ -5,7 +5,7 @@
module.exports = {
//开发环境mongodb配置
mongo: {
- uri: `mongodb://${encodeURIComponent(process.env.MONGO_USERNAME || '')}:${encodeURIComponent(process.env.MONGO_PASSWORD || '')}@localhost:27017/jackblog-dev`
+ uri: `mongodb://localhost/jackblog-dev`
},
//开发环境redis配置
redis: {
diff --git a/server/config/env/production.js b/server/config/env/production.js
index e0eb5c9..d39476c 100644
--- a/server/config/env/production.js
+++ b/server/config/env/production.js
@@ -8,7 +8,7 @@ module.exports = {
port: process.env.PORT || 8800,
//生产环境mongodb配置
mongo: {
- uri: `mongodb://${encodeURIComponent(process.env.MONGO_USERNAME || '')}:${encodeURIComponent(process.env.MONGO_PASSWORD || '')}@${MONGO_ADDR}/jackblog`
+ uri: `mongodb://${encodeURIComponent(process.env.MONGO_USERNAME)}:${encodeURIComponent(process.env.MONGO_PASSWORD)}@${MONGO_ADDR}/jackblog`
},
//生产环境redis配置
redis: {
diff --git a/server/config/env/test.js b/server/config/env/test.js
index 182c6e5..d2954e3 100644
--- a/server/config/env/test.js
+++ b/server/config/env/test.js
@@ -4,7 +4,7 @@
// ===========================
module.exports = {
mongo: {
- uri: `mongodb://${encodeURIComponent(process.env.MONGO_USERNAME || '')}:${encodeURIComponent(process.env.MONGO_PASSWORD || '')}@localhost:27017/jackblog-test`
+ uri: `mongodb://localhost/jackblog-test`
},
redis: {
db: 2,
diff --git a/server/connect.js b/server/connect.js
index a8b2a77..29c508f 100644
--- a/server/connect.js
+++ b/server/connect.js
@@ -4,7 +4,6 @@ const mongoose = require('mongoose')
const config = require('./config/env')
// 连接数据库.
-console.log(config.mongo.uri)
mongoose.connect(config.mongo.uri, config.mongo.options)
const modelsPath = path.join(__dirname, 'model')
fs.readdirSync(modelsPath).forEach(function (file) {
| | | | | | | | | | | | | | | |