Authored by zhangwenxue

chore(eslint): auto fix

... ... @@ -16,6 +16,7 @@
],
"rules": {
"camelcase": "off",
"max-len": "off"
"max-len": "off",
"no-multiple-empty-lines": ["error", {"max": 1}]
}
}
... ...
... ... @@ -43,7 +43,7 @@ export function createApp(context) {
resolve();
});
setTimeout(function () {
setTimeout(function() {
resolve();
}, 500);
});
... ...
... ... @@ -72,6 +72,6 @@ export default class reportApp {
}, this.events)
]
}
})
});
}
}
... ...
... ... @@ -8,25 +8,32 @@
*/
function getTarget(node) {
if (node === void 0) {
node = document.body
node = document.body;
}
if (node === true) { return document.body }
return node instanceof window.Node ? node : document.querySelector(node)
if (node === true) {
return document.body;
}
return node instanceof window.Node ? node : document.querySelector(node);
}
const directive = {
inserted(el, { value }, vnode) {
if (el.dataset && el.dataset.transfer !== 'true') return false;
if (el.dataset && el.dataset.transfer !== 'true') {
return false;
}
el.className = el.className ? el.className + ' v-transfer-dom' : 'v-transfer-dom';
const parentNode = el.parentNode;
if (!parentNode) return;
if (!parentNode) {
return;
}
const home = document.createComment('');
let hasMovedOut = false;
if (value !== false) {
parentNode.replaceChild(home, el); // moving out, el is no longer in the document
getTarget(value).appendChild(el); // moving into new place
hasMovedOut = true
hasMovedOut = true;
}
if (!el.__transferDomData) {
el.__transferDomData = {
... ... @@ -34,14 +41,21 @@ const directive = {
home: home,
target: getTarget(value),
hasMovedOut: hasMovedOut
}
};
}
},
componentUpdated(el, { value }) {
if (el.dataset && el.dataset.transfer !== 'true') return false;
if (el.dataset && el.dataset.transfer !== 'true') {
return false;
}
// need to make sure children are done updating (vs. `update`)
const ref$1 = el.__transferDomData;
if (!ref$1) return;
if (!ref$1) {
return;
}
// homes.get(el)
const parentNode = ref$1.parentNode;
const home = ref$1.home;
... ... @@ -50,6 +64,7 @@ const directive = {
if (!hasMovedOut && value) {
// remove from document and leave placeholder
parentNode.replaceChild(home, el);
// append to target
getTarget(value).appendChild(el);
el.__transferDomData = Object.assign({}, el.__transferDomData, { hasMovedOut: true, target: getTarget(value) });
... ... @@ -63,15 +78,20 @@ const directive = {
}
},
unbind(el) {
if (el.dataset && el.dataset.transfer !== 'true') return false;
if (el.dataset && el.dataset.transfer !== 'true') {
return false;
}
el.className = el.className.replace('v-transfer-dom', '');
const ref$1 = el.__transferDomData;
if (!ref$1) return;
if (!ref$1) {
return;
}
if (el.__transferDomData.hasMovedOut === true) {
el.__transferDomData.parentNode && el.__transferDomData.parentNode.appendChild(el)
el.__transferDomData.parentNode && el.__transferDomData.parentNode.appendChild(el);
}
el.__transferDomData = null
el.__transferDomData = null;
}
};
export default directive;
\ No newline at end of file
export default directive;
... ...
... ... @@ -2,7 +2,7 @@ export default [{
path: '/mapp/mine/ufo/bankcard.html',
name: 'bankcard',
component: () => import(/* webpackChunkName: "invite" */ './card-list')
},{
}, {
path: '/mapp/mine/ufo/bankcard/add',
name: 'bankcard.add',
component: () => import(/* webpackChunkName: "invite" */ './card-add')
... ...
... ... @@ -53,7 +53,7 @@ export default {
});
if (result.code === 200) {
const list = get(result, 'data.list', []);
const list = get(result, 'data.list', []);
if (state.pager.page === 0) {
commit(Types.FETCH_INVITE_ORDER_DETAIL_LIST, { list });
... ... @@ -76,7 +76,7 @@ export default {
return result.data.page < result.data.pageTotal;
} else {
commit(Types.FETCH_INVITE_ORDER_DETAIL_LIST_REQUEST, false)
commit(Types.FETCH_INVITE_ORDER_DETAIL_LIST_REQUEST, false);
}
return false;
... ...
export default err => {
}
\ No newline at end of file
};
... ...
const mysql = require('./mysql-client');
const TABEL = 'user_alipay';
async function insert(data) {
return mysql(TABEL).insert({
...data,
createdAt: new Date().valueOf()
createdAt: Date.now()
});
}
... ...
... ... @@ -2,6 +2,9 @@ const alipayRepository = require('./alipay.repository');
const { logger } = global.yoho;
const AlertAgent = require('../../utils/alert-manager');
/**
* dingtalk 告警
*/
const AlertType = {
MySQL: 0,
Knex: 1,
... ...
... ... @@ -2,116 +2,116 @@
const md5 = require('md5');
const microtime = function() {
let unixtimeMs = new Date().getTime();
let sec = parseInt(unixtimeMs / 1000, 10);
let unixtimeMs = new Date().getTime();
let sec = parseInt(unixtimeMs / 1000, 10);
return (unixtimeMs - (sec * 1000)) / 1000 + ' ' + sec;
return (unixtimeMs - (sec * 1000)) / 1000 + ' ' + sec;
};
const getTimestamp = function() {
let unixtimeMs = new Date().getTime();
let unixtimeMs = new Date().getTime();
return parseInt(unixtimeMs / 1000, 10);
return parseInt(unixtimeMs / 1000, 10);
};
module.exports = function(str, key, expiry, operation) {
operation = operation ? operation : 'decode';
key = key ? key : '';
expiry = expiry ? expiry : 0;
let tmpstr, tmp;
operation = operation ? operation : 'decode';
key = key ? key : '';
expiry = expiry ? expiry : 0;
let tmpstr, tmp;
let ckeyLength = 4;
let ckeyLength = 4;
key = md5(key);
key = md5(key);
// 密匙a会参与加解密
let keya = md5(key.substr(0, 16));
// 密匙a会参与加解密
let keya = md5(key.substr(0, 16));
// 密匙b会用来做数据完整性验证
let keyb = md5(key.substr(16, 16));
// 密匙b会用来做数据完整性验证
let keyb = md5(key.substr(16, 16));
// 密匙c用于变化生成的密文
let keyc = operation === 'decode' ?
str.substr(0, ckeyLength) : md5(microtime()).substr(-ckeyLength);
// 密匙c用于变化生成的密文
let keyc = operation === 'decode' ?
str.substr(0, ckeyLength) : md5(microtime()).substr(-ckeyLength);
// 参与运算的密匙
let cryptkey = keya + md5(keya + keyc);
// 参与运算的密匙
let cryptkey = keya + md5(keya + keyc);
let strbuf;
let strbuf;
if (operation === 'decode') {
str = str.substr(ckeyLength);
strbuf = new Buffer(str, 'base64');
if (operation === 'decode') {
str = str.substr(ckeyLength);
strbuf = new Buffer(str, 'base64');
// string = b.toString();
// string = b.toString();
} else {
expiry = expiry ? expiry + getTimestamp() : 0;
tmpstr = expiry.toString();
if (tmpstr.length >= 10) {
str = tmpstr.substr(0, 10) + md5(str + keyb).substr(0, 16) + str;
} else {
expiry = expiry ? expiry + getTimestamp() : 0;
tmpstr = expiry.toString();
if (tmpstr.length >= 10) {
str = tmpstr.substr(0, 10) + md5(str + keyb).substr(0, 16) + str;
} else {
let count = 10 - tmpstr.length;
for (let i = 0; i < count; i++) {
tmpstr = '0' + tmpstr;
}
str = tmpstr + md5(str + keyb).substr(0, 16) + str;
}
strbuf = new Buffer(str);
let count = 10 - tmpstr.length;
for (let i = 0; i < count; i++) {
tmpstr = '0' + tmpstr;
}
str = tmpstr + md5(str + keyb).substr(0, 16) + str;
}
strbuf = new Buffer(str);
}
let box = new Array(256);
let rndkey = [];
let box = new Array(256);
let rndkey = [];
for (let i = 0; i < 256; i++) {
box[i] = i;
for (let i = 0; i < 256; i++) {
box[i] = i;
// 产生密匙簿
rndkey[i] = cryptkey.charCodeAt(i % cryptkey.length);
}
// 产生密匙簿
rndkey[i] = cryptkey.charCodeAt(i % cryptkey.length);
}
// 用固定的算法,打乱密匙簿,增加随机性,好像很复杂,实际上对并不会增加密文的强度
for (let j = 0, i = 0; i < 256; i++) {
j = (j + box[i] + rndkey[i]) % 256;
tmp = box[i];
box[i] = box[j];
box[j] = tmp;
}
// 用固定的算法,打乱密匙簿,增加随机性,好像很复杂,实际上对并不会增加密文的强度
for (let j = 0, i = 0; i < 256; i++) {
j = (j + box[i] + rndkey[i]) % 256;
tmp = box[i];
box[i] = box[j];
box[j] = tmp;
}
// 核心加解密部分
let s = '';
// 核心加解密部分
let s = '';
for (let a = 0, j = 0, i = 0; i < strbuf.length; i++) {
a = (a + 1) % 256;
j = (j + box[a]) % 256;
tmp = box[a];
box[a] = box[j];
box[j] = tmp;
for (let a = 0, j = 0, i = 0; i < strbuf.length; i++) {
a = (a + 1) % 256;
j = (j + box[a]) % 256;
tmp = box[a];
box[a] = box[j];
box[j] = tmp;
// 从密匙簿得出密匙进行异或,再转成字符
// s += String.fromCharCode(string[i] ^ (box[(box[a] + box[j]) % 256]));
/* jshint -W016*/
strbuf[i] = strbuf[i] ^ (box[(box[a] + box[j]) % 256]);
}
// 从密匙簿得出密匙进行异或,再转成字符
// s += String.fromCharCode(string[i] ^ (box[(box[a] + box[j]) % 256]));
/* jshint -W016*/
strbuf[i] = strbuf[i] ^ (box[(box[a] + box[j]) % 256]);
}
if (operation === 'decode') {
s = strbuf.toString();
if ((s.substr(0, 10) === '0'.repeat(10) ||
if (operation === 'decode') {
s = strbuf.toString();
if ((s.substr(0, 10) === '0'.repeat(10) ||
s.substr(0, 10) - getTimestamp() > 0) &&
s.substr(10, 16) === md5(s.substr(26) + keyb).substr(0, 16)) {
s = s.substr(26);
} else {
s = '';
}
s = s.substr(26);
} else {
s = strbuf.toString('base64');
let regex = new RegExp('=', 'g');
s = s.replace(regex, '');
s = keyc + s;
s = '';
}
} else {
s = strbuf.toString('base64');
let regex = new RegExp('=', 'g');
s = s.replace(regex, '');
s = keyc + s;
}
return s;
return s;
};
... ...