From 7eee57e11f429d3a1c83ea6723558fdafa83457a Mon Sep 17 00:00:00 2001 From: zhangyiming Date: Mon, 30 Nov 2020 20:00:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E6=8E=A5=E5=8F=A3=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=EF=BC=8Cswagger=E6=96=87=E6=A1=A3=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.env | 3 + backend/package-lock.json | 390 +++++++++++++++++++----------- backend/package.json | 3 + backend/src/app.ts | 32 +-- backend/src/config/index.ts | 16 +- backend/src/loaders/logger.ts | 12 +- backend/src/models/mysql/index.ts | 2 +- backend/src/router/api/mysql.ts | 169 ++++++++++--- backend/src/server.ts | 35 +-- backend/src/utils/initMysql.ts | 19 +- 10 files changed, 451 insertions(+), 230 deletions(-) diff --git a/backend/.env b/backend/.env index 0e3a866d6..7ad74d755 100644 --- a/backend/.env +++ b/backend/.env @@ -1,5 +1,8 @@ # Port PORT=3000 +# JWT_SECRET +JWT_SECRET = '708DD1DC5BC5A169' + # Debug LOG_LEVEL='debug' \ No newline at end of file diff --git a/backend/package-lock.json b/backend/package-lock.json index 9571ab61d..9597d80c1 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -124,13 +124,19 @@ }, "ansi-align": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", + "resolved": "http://192.168.250.101:4873/ansi-align/-/ansi-align-2.0.0.tgz", "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", "dev": true, "requires": { "string-width": "^2.0.0" } }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "http://192.168.250.101:4873/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, "anymatch": { "version": "2.0.0", "resolved": "http://192.168.250.101:4873/anymatch/-/anymatch-2.0.0.tgz", @@ -162,7 +168,7 @@ }, "arr-diff": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "resolved": "http://192.168.250.101:4873/arr-diff/-/arr-diff-4.0.0.tgz", "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", "dev": true }, @@ -174,7 +180,7 @@ }, "arr-union": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "resolved": "http://192.168.250.101:4873/arr-union/-/arr-union-3.1.0.tgz", "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", "dev": true }, @@ -185,13 +191,13 @@ }, "array-unique": { "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "resolved": "http://192.168.250.101:4873/array-unique/-/array-unique-0.3.2.tgz", "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, "assign-symbols": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "resolved": "http://192.168.250.101:4873/assign-symbols/-/assign-symbols-1.0.0.tgz", "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, @@ -234,7 +240,7 @@ "dependencies": { "define-property": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "resolved": "http://192.168.250.101:4873/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { @@ -359,7 +365,7 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "resolved": "http://192.168.250.101:4873/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { @@ -368,6 +374,11 @@ } } }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "http://192.168.250.101:4873/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", @@ -403,7 +414,7 @@ }, "camelcase": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "resolved": "http://192.168.250.101:4873/camelcase/-/camelcase-4.1.0.tgz", "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", "dev": true }, @@ -484,7 +495,7 @@ "dependencies": { "define-property": { "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "resolved": "http://192.168.250.101:4873/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { @@ -495,13 +506,13 @@ }, "cli-boxes": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", + "resolved": "http://192.168.250.101:4873/cli-boxes/-/cli-boxes-1.0.0.tgz", "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=", "dev": true }, "collection-visit": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "resolved": "http://192.168.250.101:4873/collection-visit/-/collection-visit-1.0.0.tgz", "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", "dev": true, "requires": { @@ -609,7 +620,7 @@ }, "copy-descriptor": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "resolved": "http://192.168.250.101:4873/copy-descriptor/-/copy-descriptor-0.1.1.tgz", "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", "dev": true }, @@ -625,7 +636,7 @@ }, "create-error-class": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", + "resolved": "http://192.168.250.101:4873/create-error-class/-/create-error-class-3.0.2.tgz", "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", "dev": true, "requires": { @@ -634,7 +645,7 @@ }, "cross-spawn": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "resolved": "http://192.168.250.101:4873/cross-spawn/-/cross-spawn-5.1.0.tgz", "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "dev": true, "requires": { @@ -645,7 +656,7 @@ }, "crypto-random-string": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", + "resolved": "http://192.168.250.101:4873/crypto-random-string/-/crypto-random-string-1.0.0.tgz", "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=", "dev": true }, @@ -666,7 +677,7 @@ }, "decode-uri-component": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "resolved": "http://192.168.250.101:4873/decode-uri-component/-/decode-uri-component-0.2.0.tgz", "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", "dev": true }, @@ -770,10 +781,18 @@ }, "duplexer3": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "resolved": "http://192.168.250.101:4873/duplexer3/-/duplexer3-0.1.4.tgz", "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", "dev": true }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "http://192.168.250.101:4873/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha1-rg8PothQRe8UqBfao86azQSJ5b8=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -817,7 +836,7 @@ }, "execa": { "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "resolved": "http://192.168.250.101:4873/execa/-/execa-0.7.0.tgz", "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", "dev": true, "requires": { @@ -832,7 +851,7 @@ }, "expand-brackets": { "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "resolved": "http://192.168.250.101:4873/expand-brackets/-/expand-brackets-2.1.4.tgz", "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "dev": true, "requires": { @@ -856,7 +875,7 @@ }, "define-property": { "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "resolved": "http://192.168.250.101:4873/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { @@ -865,7 +884,7 @@ }, "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "resolved": "http://192.168.250.101:4873/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { @@ -944,7 +963,7 @@ }, "extend-shallow": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "resolved": "http://192.168.250.101:4873/extend-shallow/-/extend-shallow-3.0.2.tgz", "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "dev": true, "requires": { @@ -981,7 +1000,7 @@ "dependencies": { "define-property": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "resolved": "http://192.168.250.101:4873/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { @@ -990,7 +1009,7 @@ }, "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "resolved": "http://192.168.250.101:4873/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { @@ -1047,7 +1066,7 @@ }, "fill-range": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "resolved": "http://192.168.250.101:4873/fill-range/-/fill-range-4.0.0.tgz", "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "dev": true, "requires": { @@ -1059,7 +1078,7 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "resolved": "http://192.168.250.101:4873/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { @@ -1099,7 +1118,7 @@ }, "for-in": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "resolved": "http://192.168.250.101:4873/for-in/-/for-in-1.0.2.tgz", "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", "dev": true }, @@ -1115,7 +1134,7 @@ }, "fragment-cache": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "resolved": "http://192.168.250.101:4873/fragment-cache/-/fragment-cache-0.2.1.tgz", "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "dev": true, "requires": { @@ -1699,13 +1718,13 @@ }, "get-stream": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "resolved": "http://192.168.250.101:4873/get-stream/-/get-stream-3.0.0.tgz", "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", "dev": true }, "get-value": { "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "resolved": "http://192.168.250.101:4873/get-value/-/get-value-2.0.6.tgz", "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", "dev": true }, @@ -1724,7 +1743,7 @@ }, "glob-parent": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "resolved": "http://192.168.250.101:4873/glob-parent/-/glob-parent-3.1.0.tgz", "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", "dev": true, "requires": { @@ -1734,7 +1753,7 @@ "dependencies": { "is-glob": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "resolved": "http://192.168.250.101:4873/is-glob/-/is-glob-3.1.0.tgz", "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", "dev": true, "requires": { @@ -1745,7 +1764,7 @@ }, "global-dirs": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", + "resolved": "http://192.168.250.101:4873/global-dirs/-/global-dirs-0.1.1.tgz", "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", "dev": true, "requires": { @@ -1754,7 +1773,7 @@ }, "got": { "version": "6.7.1", - "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", + "resolved": "http://192.168.250.101:4873/got/-/got-6.7.1.tgz", "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", "dev": true, "requires": { @@ -1794,7 +1813,7 @@ }, "has-value": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "resolved": "http://192.168.250.101:4873/has-value/-/has-value-1.0.0.tgz", "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", "dev": true, "requires": { @@ -1805,7 +1824,7 @@ }, "has-values": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "resolved": "http://192.168.250.101:4873/has-values/-/has-values-1.0.0.tgz", "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", "dev": true, "requires": { @@ -1815,7 +1834,7 @@ "dependencies": { "kind-of": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "resolved": "http://192.168.250.101:4873/kind-of/-/kind-of-4.0.0.tgz", "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", "dev": true, "requires": { @@ -1846,19 +1865,19 @@ }, "ignore-by-default": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "resolved": "http://192.168.250.101:4873/ignore-by-default/-/ignore-by-default-1.0.1.tgz", "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", "dev": true }, "import-lazy": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "resolved": "http://192.168.250.101:4873/import-lazy/-/import-lazy-2.1.0.tgz", "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", "dev": true }, "imurmurhash": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "resolved": "http://192.168.250.101:4873/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, @@ -1889,7 +1908,7 @@ }, "is-accessor-descriptor": { "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "resolved": "http://192.168.250.101:4873/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "dev": true, "requires": { @@ -1898,7 +1917,7 @@ "dependencies": { "kind-of": { "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "resolved": "http://192.168.250.101:4873/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { @@ -1914,7 +1933,7 @@ }, "is-binary-path": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "resolved": "http://192.168.250.101:4873/is-binary-path/-/is-binary-path-1.0.1.tgz", "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", "dev": true, "requires": { @@ -1947,7 +1966,7 @@ }, "is-data-descriptor": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "resolved": "http://192.168.250.101:4873/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "dev": true, "requires": { @@ -1956,7 +1975,7 @@ "dependencies": { "kind-of": { "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "resolved": "http://192.168.250.101:4873/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { @@ -1992,19 +2011,19 @@ }, "is-extendable": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "resolved": "http://192.168.250.101:4873/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", "dev": true }, "is-extglob": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "resolved": "http://192.168.250.101:4873/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, "is-fullwidth-code-point": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "resolved": "http://192.168.250.101:4873/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, @@ -2019,7 +2038,7 @@ }, "is-installed-globally": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", + "resolved": "http://192.168.250.101:4873/is-installed-globally/-/is-installed-globally-0.1.0.tgz", "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", "dev": true, "requires": { @@ -2029,13 +2048,13 @@ }, "is-npm": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", + "resolved": "http://192.168.250.101:4873/is-npm/-/is-npm-1.0.0.tgz", "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=", "dev": true }, "is-number": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "resolved": "http://192.168.250.101:4873/is-number/-/is-number-3.0.0.tgz", "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { @@ -2044,7 +2063,7 @@ "dependencies": { "kind-of": { "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "resolved": "http://192.168.250.101:4873/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { @@ -2055,13 +2074,13 @@ }, "is-obj": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "resolved": "http://192.168.250.101:4873/is-obj/-/is-obj-1.0.1.tgz", "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", "dev": true }, "is-path-inside": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "resolved": "http://192.168.250.101:4873/is-path-inside/-/is-path-inside-1.0.1.tgz", "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", "dev": true, "requires": { @@ -2084,7 +2103,7 @@ }, "is-redirect": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", + "resolved": "http://192.168.250.101:4873/is-redirect/-/is-redirect-1.0.0.tgz", "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=", "dev": true }, @@ -2096,7 +2115,7 @@ }, "is-stream": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "resolved": "http://192.168.250.101:4873/is-stream/-/is-stream-1.1.0.tgz", "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, @@ -2122,13 +2141,13 @@ }, "isexe": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "resolved": "http://192.168.250.101:4873/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, "isobject": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "resolved": "http://192.168.250.101:4873/isobject/-/isobject-3.0.1.tgz", "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true }, @@ -2168,6 +2187,49 @@ "resolved": "http://192.168.250.101:4873/jsonschema-draft4/-/jsonschema-draft4-1.0.0.tgz", "integrity": "sha1-8K8gBQVPDwrefqIRhhS2ncUS2GU=" }, + "jsonwebtoken": { + "version": "8.5.1", + "resolved": "http://192.168.250.101:4873/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", + "integrity": "sha1-AOceC431TCEhofJhN98igGc7zA0=", + "requires": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^5.6.0" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "http://192.168.250.101:4873/ms/-/ms-2.1.2.tgz", + "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=" + } + } + }, + "jwa": { + "version": "1.4.1", + "resolved": "http://192.168.250.101:4873/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha1-dDwymFy56YZVUw1TZBtmyGRbA5o=", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.2.2", + "resolved": "http://192.168.250.101:4873/jws/-/jws-3.2.2.tgz", + "integrity": "sha1-ABCZ82OUaMlBQADpmZX6UvtHgwQ=", + "requires": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, "kind-of": { "version": "6.0.3", "resolved": "http://192.168.250.101:4873/kind-of/-/kind-of-6.0.3.tgz", @@ -2181,7 +2243,7 @@ }, "latest-version": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz", + "resolved": "http://192.168.250.101:4873/latest-version/-/latest-version-3.1.0.tgz", "integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=", "dev": true, "requires": { @@ -2193,11 +2255,46 @@ "resolved": "http://192.168.250.101:4873/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" }, + "lodash.includes": { + "version": "4.3.0", + "resolved": "http://192.168.250.101:4873/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" + }, + "lodash.isboolean": { + "version": "3.0.3", + "resolved": "http://192.168.250.101:4873/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" + }, "lodash.isequal": { "version": "4.5.0", "resolved": "http://192.168.250.101:4873/lodash.isequal/-/lodash.isequal-4.5.0.tgz", "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" }, + "lodash.isinteger": { + "version": "4.0.4", + "resolved": "http://192.168.250.101:4873/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=" + }, + "lodash.isnumber": { + "version": "3.0.3", + "resolved": "http://192.168.250.101:4873/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "http://192.168.250.101:4873/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "http://192.168.250.101:4873/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" + }, + "lodash.once": { + "version": "4.1.1", + "resolved": "http://192.168.250.101:4873/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" + }, "logform": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/logform/-/logform-2.2.0.tgz", @@ -2248,19 +2345,24 @@ }, "map-cache": { "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "resolved": "http://192.168.250.101:4873/map-cache/-/map-cache-0.2.2.tgz", "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", "dev": true }, "map-visit": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "resolved": "http://192.168.250.101:4873/map-visit/-/map-visit-1.0.0.tgz", "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", "dev": true, "requires": { "object-visit": "^1.0.0" } }, + "md5-node": { + "version": "1.0.1", + "resolved": "http://192.168.250.101:4873/md5-node/-/md5-node-1.0.1.tgz", + "integrity": "sha1-DiLQCdRr3JWx08XoyP7dwaXDqog=" + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -2464,21 +2566,12 @@ "resolved": "http://192.168.250.101:4873/semver/-/semver-5.7.1.tgz", "integrity": "sha1-qVT5Ma66UI0we78Gnv8MAclhFvc=", "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "http://192.168.250.101:4873/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha1-4uaaRKyHcveKHsCzW2id9lMO/I8=", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } } } }, "nopt": { "version": "1.0.10", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "resolved": "http://192.168.250.101:4873/nopt/-/nopt-1.0.10.tgz", "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", "dev": true, "requires": { @@ -2493,7 +2586,7 @@ }, "npm-run-path": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "resolved": "http://192.168.250.101:4873/npm-run-path/-/npm-run-path-2.0.2.tgz", "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "dev": true, "requires": { @@ -2502,7 +2595,7 @@ }, "object-copy": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "resolved": "http://192.168.250.101:4873/object-copy/-/object-copy-0.1.0.tgz", "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", "dev": true, "requires": { @@ -2513,7 +2606,7 @@ "dependencies": { "define-property": { "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "resolved": "http://192.168.250.101:4873/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { @@ -2522,7 +2615,7 @@ }, "kind-of": { "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "resolved": "http://192.168.250.101:4873/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { @@ -2533,7 +2626,7 @@ }, "object-visit": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "resolved": "http://192.168.250.101:4873/object-visit/-/object-visit-1.0.1.tgz", "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "dev": true, "requires": { @@ -2542,7 +2635,7 @@ }, "object.pick": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "resolved": "http://192.168.250.101:4873/object.pick/-/object.pick-1.3.0.tgz", "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", "dev": true, "requires": { @@ -2601,15 +2694,23 @@ "swagger-schema-official": "2.0.0-bab6bed" } }, + "opentype.js": { + "version": "0.7.3", + "resolved": "http://192.168.250.101:4873/opentype.js/-/opentype.js-0.7.3.tgz", + "integrity": "sha1-QPuM4Yv9YOdESO/f5EKDQJg5eqs=", + "requires": { + "tiny-inflate": "^1.0.2" + } + }, "p-finally": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "resolved": "http://192.168.250.101:4873/p-finally/-/p-finally-1.0.0.tgz", "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", "dev": true }, "package-json": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", + "resolved": "http://192.168.250.101:4873/package-json/-/package-json-4.0.1.tgz", "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=", "dev": true, "requires": { @@ -2626,13 +2727,13 @@ }, "pascalcase": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "resolved": "http://192.168.250.101:4873/pascalcase/-/pascalcase-0.1.1.tgz", "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true }, "path-dirname": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "resolved": "http://192.168.250.101:4873/path-dirname/-/path-dirname-1.0.2.tgz", "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", "dev": true }, @@ -2643,13 +2744,13 @@ }, "path-is-inside": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "resolved": "http://192.168.250.101:4873/path-is-inside/-/path-is-inside-1.0.2.tgz", "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", "dev": true }, "path-key": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "resolved": "http://192.168.250.101:4873/path-key/-/path-key-2.0.1.tgz", "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, @@ -2666,19 +2767,19 @@ }, "pify": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "resolved": "http://192.168.250.101:4873/pify/-/pify-3.0.0.tgz", "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true }, "posix-character-classes": { "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "resolved": "http://192.168.250.101:4873/posix-character-classes/-/posix-character-classes-0.1.1.tgz", "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", "dev": true }, "prepend-http": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "resolved": "http://192.168.250.101:4873/prepend-http/-/prepend-http-1.0.4.tgz", "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", "dev": true }, @@ -2792,7 +2893,7 @@ }, "registry-url": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", + "resolved": "http://192.168.250.101:4873/registry-url/-/registry-url-3.1.0.tgz", "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", "dev": true, "requires": { @@ -2801,7 +2902,7 @@ }, "remove-trailing-separator": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "resolved": "http://192.168.250.101:4873/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", "dev": true }, @@ -2813,7 +2914,7 @@ }, "repeat-string": { "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "resolved": "http://192.168.250.101:4873/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, @@ -2829,7 +2930,7 @@ }, "resolve-url": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "resolved": "http://192.168.250.101:4873/resolve-url/-/resolve-url-0.2.1.tgz", "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "dev": true }, @@ -2846,7 +2947,7 @@ }, "safe-regex": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "resolved": "http://192.168.250.101:4873/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { @@ -2861,12 +2962,11 @@ "semver": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", - "dev": true + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" }, "semver-diff": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", + "resolved": "http://192.168.250.101:4873/semver-diff/-/semver-diff-2.1.0.tgz", "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", "dev": true, "requires": { @@ -2945,7 +3045,7 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "resolved": "http://192.168.250.101:4873/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { @@ -2961,7 +3061,7 @@ }, "shebang-command": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "resolved": "http://192.168.250.101:4873/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { @@ -2970,7 +3070,7 @@ }, "shebang-regex": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "resolved": "http://192.168.250.101:4873/shebang-regex/-/shebang-regex-1.0.0.tgz", "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, @@ -3015,7 +3115,7 @@ }, "define-property": { "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "resolved": "http://192.168.250.101:4873/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { @@ -3024,7 +3124,7 @@ }, "extend-shallow": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "resolved": "http://192.168.250.101:4873/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { @@ -3046,7 +3146,7 @@ "dependencies": { "define-property": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "resolved": "http://192.168.250.101:4873/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { @@ -3095,7 +3195,7 @@ "dependencies": { "kind-of": { "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "resolved": "http://192.168.250.101:4873/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { @@ -3106,7 +3206,7 @@ }, "source-map": { "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "resolved": "http://192.168.250.101:4873/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, @@ -3125,7 +3225,7 @@ }, "source-map-url": { "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "resolved": "http://192.168.250.101:4873/source-map-url/-/source-map-url-0.4.0.tgz", "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", "dev": true }, @@ -3155,7 +3255,7 @@ }, "static-extend": { "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "resolved": "http://192.168.250.101:4873/static-extend/-/static-extend-0.1.2.tgz", "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", "dev": true, "requires": { @@ -3165,7 +3265,7 @@ "dependencies": { "define-property": { "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "resolved": "http://192.168.250.101:4873/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { @@ -3187,23 +3287,6 @@ "requires": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } } }, "string_decoder": { @@ -3214,18 +3297,44 @@ "safe-buffer": "~5.1.0" } }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "http://192.168.250.101:4873/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, "strip-eof": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "resolved": "http://192.168.250.101:4873/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, "strip-json-comments": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "resolved": "http://192.168.250.101:4873/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true }, + "supports-color": { + "version": "5.5.0", + "resolved": "http://192.168.250.101:4873/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha1-4uaaRKyHcveKHsCzW2id9lMO/I8=", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "svg-captcha": { + "version": "1.4.0", + "resolved": "http://192.168.250.101:4873/svg-captcha/-/svg-captcha-1.4.0.tgz", + "integrity": "sha1-MurTxkY5NsIYuzvJ7QT+pO7/5JI=", + "requires": { + "opentype.js": "^0.7.3" + } + }, "swagger-methods": { "version": "1.0.8", "resolved": "http://192.168.250.101:4873/swagger-methods/-/swagger-methods-1.0.8.tgz", @@ -3253,7 +3362,7 @@ }, "term-size": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", + "resolved": "http://192.168.250.101:4873/term-size/-/term-size-1.2.0.tgz", "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", "dev": true, "requires": { @@ -3267,13 +3376,18 @@ }, "timed-out": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", + "resolved": "http://192.168.250.101:4873/timed-out/-/timed-out-4.0.1.tgz", "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", "dev": true }, + "tiny-inflate": { + "version": "1.0.3", + "resolved": "http://192.168.250.101:4873/tiny-inflate/-/tiny-inflate-1.0.3.tgz", + "integrity": "sha1-EicVSUkToYBRZqr3yTRnkz7qJsQ=" + }, "to-object-path": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "resolved": "http://192.168.250.101:4873/to-object-path/-/to-object-path-0.3.0.tgz", "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", "dev": true, "requires": { @@ -3282,7 +3396,7 @@ "dependencies": { "kind-of": { "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "resolved": "http://192.168.250.101:4873/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { @@ -3305,7 +3419,7 @@ }, "to-regex-range": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "resolved": "http://192.168.250.101:4873/to-regex-range/-/to-regex-range-2.1.1.tgz", "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", "dev": true, "requires": { @@ -3417,7 +3531,7 @@ }, "unique-string": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", + "resolved": "http://192.168.250.101:4873/unique-string/-/unique-string-1.0.0.tgz", "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", "dev": true, "requires": { @@ -3431,7 +3545,7 @@ }, "unset-value": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "resolved": "http://192.168.250.101:4873/unset-value/-/unset-value-1.0.0.tgz", "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", "dev": true, "requires": { @@ -3441,7 +3555,7 @@ "dependencies": { "has-value": { "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "resolved": "http://192.168.250.101:4873/has-value/-/has-value-0.3.1.tgz", "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", "dev": true, "requires": { @@ -3452,7 +3566,7 @@ "dependencies": { "isobject": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "resolved": "http://192.168.250.101:4873/isobject/-/isobject-2.1.0.tgz", "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", "dev": true, "requires": { @@ -3463,7 +3577,7 @@ }, "has-values": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "resolved": "http://192.168.250.101:4873/has-values/-/has-values-0.1.4.tgz", "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", "dev": true } @@ -3471,7 +3585,7 @@ }, "unzip-response": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", + "resolved": "http://192.168.250.101:4873/unzip-response/-/unzip-response-2.0.1.tgz", "integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=", "dev": true }, @@ -3501,13 +3615,13 @@ }, "urix": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "resolved": "http://192.168.250.101:4873/urix/-/urix-0.1.0.tgz", "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", "dev": true }, "url-parse-lax": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "resolved": "http://192.168.250.101:4873/url-parse-lax/-/url-parse-lax-1.0.0.tgz", "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", "dev": true, "requires": { @@ -3618,7 +3732,7 @@ }, "xdg-basedir": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", + "resolved": "http://192.168.250.101:4873/xdg-basedir/-/xdg-basedir-3.0.0.tgz", "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=", "dev": true }, diff --git a/backend/package.json b/backend/package.json index 1375ccf8e..f01e22373 100644 --- a/backend/package.json +++ b/backend/package.json @@ -22,7 +22,10 @@ "dotenv": "^8.2.0", "express": "^4.17.1", "express-swagger-generator": "^1.1.17", + "jsonwebtoken": "^8.5.1", + "md5-node": "^1.0.1", "mysql2": "^2.2.5", + "svg-captcha": "^1.4.0", "winston": "^3.3.3" } } diff --git a/backend/src/app.ts b/backend/src/app.ts index b875ce302..4549ab0ce 100644 --- a/backend/src/app.ts +++ b/backend/src/app.ts @@ -1,31 +1,31 @@ -import * as express from "express"; -import * as bodyParser from "body-parser"; +import * as express from "express" +import * as bodyParser from "body-parser" class App { - public app: express.Application; + public app: express.Application constructor() { - this.app = express(); - this.config(); + this.app = express() + this.config() } private config(): void { // 支持json编码的主体 - this.app.use(bodyParser.json()); + this.app.use(bodyParser.json()) // 支持编码的主体 this.app.use(bodyParser.urlencoded({ extended: true, - })); + })) // 设置静态访问目录(Swagger) - this.app.use(express.static('public')); + this.app.use(express.static('public')) // 设置跨域访问 this.app.all('*', (req, res, next) => { - res.header('Access-Control-Allow-Origin', '*'); - res.header('Access-Control-Allow-Headers', 'content-type'); - res.header('Access-Control-Allow-Methods', 'PUT,POST,GET,DELETE,OPTIONS'); - res.header('X-Powered-By', ' 3.2.1'); - res.header('Content-Type', 'application/json;charset=utf-8'); - next(); - }); + res.header('Access-Control-Allow-Origin', '*') + res.header('Access-Control-Allow-Headers', 'content-type') + res.header('Access-Control-Allow-Methods', 'PUT,POST,GET,DELETE,OPTIONS') + res.header('X-Powered-By', ' 3.2.1') + res.header('Content-Type', 'application/json;charset=utf-8') + next() + }) } } -export default new App().app; +export default new App().app diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index c88e3c2e7..01fd4d15a 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -1,11 +1,11 @@ -import * as dotenv from "dotenv"; +import * as dotenv from "dotenv" -process.env.NODE_ENV = process.env.NODE_ENV || "development"; +process.env.NODE_ENV = process.env.NODE_ENV || "development" -const envFound = dotenv.config(); +const envFound = dotenv.config() if (envFound.error) { - throw new Error("⚠️ Couldn't find .env file ⚠️"); + throw new Error("⚠️ Couldn't find .env file ⚠️") } export default { @@ -52,10 +52,10 @@ export default { host: 'localhost', charset: 'utf8_general_ci', user: 'root', - password: '123456789' + password: 'admin' }, - mongodb:{}, - sqlite:{}, + mongodb: {}, + sqlite: {}, api: { prefix: '/api', }, @@ -63,4 +63,4 @@ export default { apiKey: process.env.MAILGUN_API_KEY, domain: process.env.MAILGUN_DOMAIN } -}; +} diff --git a/backend/src/loaders/logger.ts b/backend/src/loaders/logger.ts index ed53c2165..7d5f2c0a6 100644 --- a/backend/src/loaders/logger.ts +++ b/backend/src/loaders/logger.ts @@ -1,9 +1,9 @@ -import config from "../config"; -import * as winston from "winston"; +import config from "../config" +import * as winston from "winston" -const transports = []; -if(process.env.NODE_ENV !== 'development') { +const transports = [] +if (process.env.NODE_ENV !== 'development') { transports.push( new winston.transports.Console() ) @@ -30,6 +30,6 @@ const LoggerInstance = winston.createLogger({ winston.format.json() ), transports -}); +}) -export default LoggerInstance; \ No newline at end of file +export default LoggerInstance \ No newline at end of file diff --git a/backend/src/models/mysql/index.ts b/backend/src/models/mysql/index.ts index 5ae8299ff..6efc09ad0 100644 --- a/backend/src/models/mysql/index.ts +++ b/backend/src/models/mysql/index.ts @@ -1,5 +1,5 @@ // 创建用户表 -const user = 'CREATE TABLE if not EXISTS users(id int PRIMARY key auto_increment,account varchar(32),psw varchar(32))' +const user = 'CREATE TABLE if not EXISTS users(id int PRIMARY key auto_increment,username varchar(32),password varchar(32))' export { user diff --git a/backend/src/router/api/mysql.ts b/backend/src/router/api/mysql.ts index 86f132676..2aab9d4eb 100644 --- a/backend/src/router/api/mysql.ts +++ b/backend/src/router/api/mysql.ts @@ -1,86 +1,182 @@ +import md5 from 'md5-node' +import jwt from "jsonwebtoken" +import jwtSecret from "../../config" +import Logger from "../../loaders/logger" import { Request, Response } from "express" +import { createMathExpr } from "svg-captcha" +import { connection } from '../../utils/initMysql' + +export interface dataModel { + length: number +} + +// 保存验证码 +let verify: number | string /** - * 登陆 - * @route GET /login/ - * @summary 登陆 - * @group login - 登陆 - * @returns {object} 200 - * @security JWT - * @returns {Error} default - Unexpected error + * @typedef Point + * @property {string} username.required - 用户名 + * @property {string} password.required - 密码 + * @property {string} verify.required - 验证码 */ -const login =async (req: Request, res: Response) => { - res.json({code:1 , msg: "成功"}) + +/** + * @typedef Error + * @property {string} code.required + */ + +/** + * @typedef Response + * @property {[integer]} code + */ + +/** + * 登录 + * @route POST /login + * @param {Point.model} point.body.required - the new point + * @produces application/json application/xml + * @consumes application/json application/xml + * @returns {Response.model} 200 + * @returns {Array.} Point + * @headers {integer} 200.X-Rate-Limit + * @headers {string} 200.X-Expires-After + * @security JWT + */ + +const login = async (req: Request, res: Response) => { + console.log(req.body) + // if (verify !== req.query.verify) return res.json({ + // code: -1, + // info: "请输入正确的验证码" + // }) + //生成jwt(token令牌) {expiresIn:3600}为token的过期时间,这里设置的是1小时 + // const accessToken = jwt.sign({ + // accountId: account.id + // }, settings.accessTokenSecret, { expiresIn: 3600 }) + // const idToken = jwt.sign({ + // sub: account.id, + // preferred_username: account.username + // }, "some secret that doesn't matter") + // //返回token + // response.status(200).json({ + // access_token: accessToken, + // id_token: idToken + // }) + // accessToken } /** * 注册 - * @route GET /register/ + * @route POST /register * @summary 注册 * @group register - 注册 + * @param {string} username.query.required - username + * @param {string} password.query.required - password + * @param {string} verify.query.required - verify * @returns {object} 200 * @security JWT - * @returns {Error} default - Unexpected error */ -const register =async (req: Request, res: Response) => { - res.json({code:1 , msg: "成功"}) +const register = async (req: Request, res: Response) => { + if (verify !== req.query.verify) return res.json({ + code: -1, + info: "请输入正确的验证码" + }) + let sql: string = 'select * from users where username=' + "'" + req.query.username + "'" + connection.query(sql, async (err, data: dataModel) => { + if (data.length > 0) { + await res.json({ + code: -1, + info: "账号已被注册" + }) + } else { + let sql: string = 'insert into users (username,password) value(' + "'" + req.query.username + "'" + ',' + "'" + req.query.password + + "'" + ')' + connection.query(sql, async function (err) { + if (err) { + Logger.error(err) + } else { + await res.json({ + code: 0, + info: "账号注册成功" + }) + } + }) + } + }) } /** * 列表更新 - * @route GET /updateList/ + * @route GET /updateList * @summary 列表更新 * @group updateList - 列表更新 * @returns {object} 200 * @security JWT - * @returns {Error} default - Unexpected error */ -const updateList =async (req: Request, res: Response) => { - res.json({code:1 , msg: "成功"}) +const updateList = async (req: Request, res: Response) => { + res.json({ code: 1, msg: "成功" }) } /** * 列表删除 - * @route GET /deleteList/ + * @route GET /deleteList * @summary 列表删除 * @group deleteList - 列表删除 * @returns {object} 200 * @security JWT - * @returns {Error} default - Unexpected error */ -const deleteList =async (req: Request, res: Response) => { - res.json({code:1 , msg: "成功"}) +const deleteList = async (req: Request, res: Response) => { + res.json({ code: 1, msg: "成功" }) } - /** - * 分页查询 - * @route GET /searchPage/ - * @summary 分页查询 - * @group searchPage - 分页查询 - * @returns {object} 200 - * @security JWT - * @returns {Error} default - Unexpected error - */ +/** +* 分页查询 +* @route GET /searchPage +* @summary 分页查询 +* @group searchPage - 分页查询 +* @returns {object} 200 +* @security JWT +* @returns {Error} default - Unexpected error +*/ -const searchPage =async (req: Request, res: Response) => { - res.json({code:1 , msg: "成功"}) +const searchPage = async (req: Request, res: Response) => { + res.json({ code: 1, msg: "成功" }) } /** * 模糊查询 - * @route GET /searchVague/ + * @route GET /searchVague * @summary 模糊查询 * @group searchVague - 模糊查询 * @returns {object} 200 * @security JWT - * @returns {Error} default - Unexpected error */ -const searchVague =async (req: Request, res: Response) => { - res.json({code:1 , msg: "成功"}) +const searchVague = async (req: Request, res: Response) => { + res.json({ code: 1, msg: "成功" }) +} + +/** + * 图形验证码 + * @route GET /captcha + * @summary 图形验证码 + * @group captcha - 图形验证码 + * @returns {object} 200 + * @security JWT + */ + +const captcha = async (req: Request, res: Response) => { + const create = createMathExpr({ + mathMin: 1, + mathMax: 4, + mathOperator: "+" + }) + verify = create.text + res.type('svg') // 响应的类型 + res.json({ code: 1, msg: create.text, svg: create.data }) } export { @@ -90,4 +186,5 @@ export { deleteList, searchPage, searchVague, + captcha, } \ No newline at end of file diff --git a/backend/src/server.ts b/backend/src/server.ts index 857ce236e..5007c5d41 100644 --- a/backend/src/server.ts +++ b/backend/src/server.ts @@ -1,29 +1,30 @@ -import app from "./app"; -import * as open from "open"; -import config from './config'; -import { user } from "./models/mysql"; -import Logger from './loaders/logger'; -import { queryTable } from "./utils/initMysql"; -const expressSwagger = require('express-swagger-generator')(app); +import app from "./app" +import * as open from "open" +import config from './config' +import { user } from "./models/mysql" +import Logger from './loaders/logger' +import { queryTable } from "./utils/initMysql" +const expressSwagger = require('express-swagger-generator')(app) expressSwagger(config.options) queryTable(user) // 引入测试数据 -import { +import { login, register, updateList, deleteList, searchPage, searchVague, + captcha, } from "./router/api/mysql" -app.get('/login', (req, res) => { +app.post('/login', (req, res) => { login(req, res) }) -app.get('/register', (req, res) => { +app.post('/register', (req, res) => { register(req, res) }) @@ -43,15 +44,19 @@ app.get('/searchVague', (req, res) => { searchVague(req, res) }) +app.get('/captcha', (req, res) => { + captcha(req, res) +}) + app.listen(config.port, () => { Logger.info(` ################################################ 🛡️ Swagger文档地址: http://localhost:${config.port} 🛡️ ################################################ - `); + `) }).on('error', err => { - Logger.error(err); - process.exit(1); -}); + Logger.error(err) + process.exit(1) +}) -open(`http://localhost:${config.port}`); // 自动打开默认浏览器 \ No newline at end of file +open(`http://localhost:${config.port}`) // 自动打开默认浏览器 \ No newline at end of file diff --git a/backend/src/utils/initMysql.ts b/backend/src/utils/initMysql.ts index fedf452a9..dcee8bbc0 100644 --- a/backend/src/utils/initMysql.ts +++ b/backend/src/utils/initMysql.ts @@ -1,14 +1,13 @@ -import * as mysql from "mysql2"; -import mysqlConfig from "../config"; -import Logger from "../loaders/logger"; +import * as mysql from "mysql2" +import mysqlConfig from "../config" +import Logger from "../loaders/logger" //user数据库 -const connection = mysql.createConnection(Object.assign({ database: 'user' }, mysqlConfig.mysql)) +export const connection = mysql.createConnection(Object.assign({ database: 'user' }, mysqlConfig.mysql)) -export function queryTable(s: string):void { - connection.query(s, (err) => { - err ? Logger.error(err) : Logger.info(`${s}表创建成功`) - }) - } +export function queryTable(s: string): void { + connection.query(s, (err) => { + err ? Logger.error(err) : Logger.info(`${s}表创建成功`) + }) +} - \ No newline at end of file