-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.js
More file actions
30 lines (26 loc) · 878 Bytes
/
common.js
File metadata and controls
30 lines (26 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
exports.clipResponse = function (srcText) {
if (srcText.indexOf('success|')) {
console.log(srcText);
let newStr = srcText.replace(/"/g, '');
const arr = newStr.split('|');
console.log(arr);
console.log(arr[0] === 'success');
if (!compareFunc(arr[0], 'success')) throw 'current api fail';
console.log(arr);
return arr;
}
throw 'current api fail';
}
let compareFunc = function (originStr, targetStr) {
if (originStr === targetStr) {
return true;
} else {
return false;
}
}
exports.clipSecureCode = function (text) {
let res = text.replace(/【Nuts】尊敬的用户,您的注册会员动态密码为:/g, '');
res = res.replace(/,请勿泄漏于他人!/g, '');
console.log(res);
return res;
}