Passed
Pull Request — master (#30)
by lv
01:57
created

app/util/response.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 13
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 0
wmc 1
eloc 9
nc 1
mnd 0
bc 1
fnc 1
dl 0
loc 13
bpm 1
cpm 1
noi 0
c 0
b 0
f 0
rs 10

1 Function

Rating   Name   Duplication   Size   Complexity  
A module.exports.output 0 10 1
1
2
module.exports = {
3
  output: function (ctx, data, code = 200, msg = '请求成功') {
4
    var json = {}
5
    json.success = true
6
    json.code = code
7
    json.data = data
8
    json.message = msg
9
10
    ctx.body = JSON.stringify(json)
11
    ctx.status = 200
12
  }
13
14
}