提交 9cdc4a97 authored 作者: vipcxj's avatar vipcxj

impove: 修复eslint报的错

上级 d4b46081
......@@ -73,7 +73,7 @@ export function encrypt(text) {
const jsEncrypt = createJSEncrypt();
jsEncrypt.setPublicKey(pubKey);
let out = jsEncrypt.encryptLong(text);
out = out.split('=')[0];
[out] = out.split('=');
out = out.replace(/\+/g, '-');
return out.replace(/\//g, '_');
}
......@@ -84,7 +84,7 @@ export function encrypt(text) {
*/
export function queryURL(name) {
const reg = new RegExp(`(^|&)${name}=([^&]*)(&|$)`, 'i');
// eslint-disable-next-line no-undef
// eslint-disable-next-line no-undef
const r = window ? window.location.search.substr(1).match(reg) : null;
if (r !== null) return decodeURI(r[2]);
return null;
......@@ -97,7 +97,7 @@ export function padDigits(number, digits) {
export function is(obj, type) {
return (type === 'Null' && obj === null) ||
(type === 'Undefined' && obj === void 0) || // eslint-disable-line no-void
(type === 'Number' && isFinite(obj)) ||
(type === 'Number' && isFinite(obj)) || // eslint-disable-line no-restricted-globals
Object.prototype.toString.call(obj).slice(8, -1) === type;
}
......@@ -125,12 +125,12 @@ export async function tryIt(times, cb, delay) {
let err;
for (let i = 0; i < times; ++i) {
try {
return await cb();
return await cb(); // eslint-disable-line
} catch (e) {
err = e;
}
if (delay) {
await sleep(delay);
await sleep(delay); // eslint-disable-line
}
}
if (err) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论