xzwebx-httpfilter 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HttpFilter.js +2 -10
- package/package.json +1 -1
package/HttpFilter.js
CHANGED
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
const Fs = require('fs')
|
|
2
2
|
const Util = require("util")
|
|
3
3
|
const Path = require('path')
|
|
4
|
-
const Crypto = require('crypto')
|
|
5
4
|
|
|
6
5
|
let ResultCodeMap = {}
|
|
7
6
|
let TipsMap = {}
|
|
8
7
|
let ModuleMap = {}
|
|
9
8
|
let ModuleInterfaceMap = {}
|
|
10
9
|
let FieldMap = {}
|
|
11
|
-
|
|
12
|
-
function decrypt(sign, key, iv) {
|
|
13
|
-
let src = ''
|
|
14
|
-
const cipher = Crypto.createDecipheriv('aes-128-cbc', 'uY4576jBeHGi5ElK', 'Kue76RJhg24WjVet')
|
|
15
|
-
src += cipher.update(sign, 'hex', 'utf8')
|
|
16
|
-
src += cipher.final('utf8')
|
|
17
|
-
return src
|
|
18
|
-
}
|
|
19
10
|
async function response(req, res, next) {
|
|
20
11
|
let retData = {
|
|
21
12
|
codeKey: 'SYSTEM_ERR',
|
|
@@ -41,8 +32,9 @@ function MSG(params) {
|
|
|
41
32
|
if (!params.msg) {
|
|
42
33
|
if (TipsMap[params.codeKey]) {
|
|
43
34
|
msg = TipsMap[params.codeKey].tips
|
|
35
|
+
} else {
|
|
36
|
+
msg = ResultCodeMap[params.codeKey].codeDesc
|
|
44
37
|
}
|
|
45
|
-
|
|
46
38
|
} else {
|
|
47
39
|
if (typeof params.msg == 'string') {
|
|
48
40
|
msg = params.msg
|