fix qrcode cannot scan out

This commit is contained in:
王劲鹏 2019-11-20 14:08:34 +08:00
parent 5814e79eb6
commit 5788860879
3 changed files with 14 additions and 13 deletions

View File

@ -10,9 +10,9 @@
"integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==" "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw=="
}, },
"@types/node": { "@types/node": {
"version": "12.12.7", "version": "12.12.11",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.7.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.11.tgz",
"integrity": "sha512-E6Zn0rffhgd130zbCbAr/JdXfXkoOUFAKNs/rF8qnafSJ8KYaA/j3oz7dcwal+lYjLA7xvdd5J4wdYpCTlP8+w==" "integrity": "sha512-O+x6uIpa6oMNTkPuHDa9MhMMehlxLAd5QcOvKRjAFsBVpeFWTOPnXbDvILvFgFFZfQ1xh1EZi1FbXxUix+zpsQ=="
}, },
"acorn": { "acorn": {
"version": "7.1.0", "version": "7.1.0",
@ -81,9 +81,9 @@
} }
}, },
"commander": { "commander": {
"version": "4.0.0", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-4.0.0.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-4.0.1.tgz",
"integrity": "sha512-SEa2abMBTZuEjLVYpNrAFoRgxPwG4rXP3+SGY6CM/HZGeDzIA7Pzp+7H3AHDukKEpyy2SoSGGPShKqqfH9T9AQ==" "integrity": "sha512-IPF4ouhCP+qdlcmCedhxX4xiGBPyigb8v5NeUp+0LyhwLgxMqyp3S0vl7TAPfS/hiP7FC3caI/PB9lTmP8r1NA=="
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
@ -251,9 +251,9 @@
} }
}, },
"rollup": { "rollup": {
"version": "1.26.5", "version": "1.27.2",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-1.26.5.tgz", "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.27.2.tgz",
"integrity": "sha512-c6Pv0yWzjYNpy2DIhLFUnyP6e1UTGownr4IfpJcPY/k186RJjpaGGPRwKQ62KCauctG6dgtHt88pw1EGrPRkuA==", "integrity": "sha512-sD3iyd0zlvgK1S3MmICi6F/Y+R/QWY5XxzsTGN4pAd+nCasDUizmAhgq2hdh1t2eLux974NHU2TW41fhuGPv+Q==",
"requires": { "requires": {
"@types/estree": "*", "@types/estree": "*",
"@types/node": "*", "@types/node": "*",

View File

@ -22,11 +22,11 @@
"dependencies": { "dependencies": {
"child_process": "^1.0.2", "child_process": "^1.0.2",
"chokidar": "^3.3.0", "chokidar": "^3.3.0",
"commander": "^4.0.0", "commander": "^4.0.1",
"keypress": "^0.2.1", "keypress": "^0.2.1",
"nodejs-websocket": "^1.7.2", "nodejs-websocket": "^1.7.2",
"qrcode-terminal": "^0.12.0", "qrcode-terminal": "^0.12.0",
"rollup": "^1.26.5", "rollup": "^1.27.2",
"shelljs": "^0.8.3", "shelljs": "^0.8.3",
"source-map-merger": "^0.2.0", "source-map-merger": "^0.2.0",
"typescript": "^3.7.2" "typescript": "^3.7.2"

View File

@ -48,10 +48,11 @@ function getIPAdress() {
const qrcode = require('qrcode-terminal'); const qrcode = require('qrcode-terminal');
const ips = getIPAdress() const ips = getIPAdress()
ips.forEach(e => { ips.forEach(e => {
console.log(`IP:${e}`) console.log(`IP:${e}`)
qrcode.generate(e, { small: true }); qrcode.generate(e, { small: false });
}) })
const keypress = require('keypress'); const keypress = require('keypress');
@ -61,7 +62,7 @@ process.stdin.on('keypress', function (ch, key) {
if (key && key.ctrl && key.name == 'r') { if (key && key.ctrl && key.name == 'r') {
ips.forEach(e => { ips.forEach(e => {
console.log(`IP:${e}`) console.log(`IP:${e}`)
qrcode.generate(e, { small: true }); qrcode.generate(e, { small: false });
}) })
} }
if (key && key.ctrl && key.name == 'c') { if (key && key.ctrl && key.name == 'c') {