lintry

调整命名

......@@ -41,23 +41,23 @@ const Authenticator = function (secret, options) {
};
/**
* 获取QR显示值
* @param title
* 获取授权定义地址
* @param label
* @param issuer
* @return {string}
*/
this.getOtpAuth = function (title, issuer) {
this.getOtpAuthURL = function (label, issuer) {
return speakeasy.otpauthURL(_.merge({}, TOTP_OPTIONS, {label: title, issuer: issuer}));
};
/**
* 生成svg的QR图片内容
* @param title
* @param label
* @param issuer
* @return {*}
*/
this.getQR = function(title, issuer) {
return qr.imageSync(this.getOtpAuth(title, issuer), { type: 'svg' });
this.getQR = function(label, issuer) {
return qr.imageSync(this.getOtpAuthURL(label, issuer), { type: 'svg' });
};
/**
......
......@@ -45,7 +45,7 @@ fs.ensureDir(img_path, function (err, added_root) {
fs.writeSync(fd, authenticator.getQR('totp@gitlab.kmlab.com', '通行密钥'));
fs.closeSync(fd);
console.log(chalk.green('密钥字符串'), chalk.yellow(authenticator.getOtpAuth('totp@gitlab.kmlab.com', '通行密钥')))
console.log(chalk.green('密钥字符串'), chalk.yellow(authenticator.getOtpAuthURL('totp@gitlab.kmlab.com', '通行密钥')))
});
console.log('QR SVG output is', img_path, qr);
\ No newline at end of file
......