From 56c44d6b12c031b9be771f50bff658c3bd40c4e2 Mon Sep 17 00:00:00 2001 From: baiy Date: Wed, 21 Jul 2021 18:28:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20jwt=20=E8=A7=A3=E7=A0=81?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=20#52?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 -- README.md | 2 + package-lock.json | 7 +++- package.json | 1 + src/config.js | 4 +- src/tool.router.js | 4 ++ src/views/tool/jwt.vue | 91 +++++++++++++++++++----------------------- 7 files changed, 57 insertions(+), 55 deletions(-) diff --git a/.gitignore b/.gitignore index 59b40bc..7cfc9ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,11 @@ .DS_Store /node_modules -/temp_release /desktop/node_modules /dist /public/manifest.json /public/plugin.json /public/README.md /id_rsa.pem -/public/_locales # local env files .env.local @@ -27,4 +25,3 @@ yarn-error.log* *.sln *.sw* test.js -/public/background.js diff --git a/README.md b/README.md index 42a486b..474ec1c 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ npm run serve -adapter=utools |JSON转实体类|`Java`, `C#`, `Go`, `Dart`|√| |ascii编码转换|`十进制`, `十六进制`, `八进制`, `二进制`, `字符串`|√| |变量名格式转换|`Var Name`, `var-name`, `VAR_NAME`, `VarName`, `varName`, `var_name`, `var name`|√| +|jwt解码|`header`, `payload`|√| ## 第三方开源库 项目诞生离不开这些优秀的开源程序 @@ -96,6 +97,7 @@ npm run serve -adapter=utools - [vue-codemirror](https://www.npmjs.com/package/vue-codemirror) - [sm-crypto](https://github.com/JuneAndGreen/sm-crypto) - [camelcaseplugin](https://github.com/netnexus/camelcaseplugin) +- [jwt-decode](https://www.npmjs.com/package/jwt-decode) > 当然项目中还使用很多不知道姓名的大神的代码, 在这里就不一一感谢 diff --git a/package-lock.json b/package-lock.json index a1f08f4..021470b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "c-tool", - "version": "1.6.1", + "version": "1.6.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -6852,6 +6852,11 @@ "resolved": "https://registry.npmjs.org/jsqr/-/jsqr-1.3.1.tgz", "integrity": "sha512-zCTP6Qd/WwjrpuHFkJuXc5opRdKprUr7eI7+JCCtcetThJt45qptu82MWQ+eET+FtDrMo7+BYjo3iD0XIq1L9Q==" }, + "jwt-decode": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz", + "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==" + }, "killable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", diff --git a/package.json b/package.json index 8a669d9..83ade64 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "js-yaml": "^3.14.1", "json-to-properties": "^1.1.3", "jsonlint": "^1.6.3", + "jwt-decode": "^3.1.2", "lodash": "^4.17.21", "lscache": "^1.3.0", "moment": "^2.29.1", diff --git a/src/config.js b/src/config.js index c6b23b6..cceb253 100644 --- a/src/config.js +++ b/src/config.js @@ -39,6 +39,7 @@ const tool = [ {'name': 'jsonToObject', 'title': 'JSON转实体类', 'cat': ['conversion', 'serialize']}, {'name': 'ascii', 'title': 'ascii转换', 'cat': ['conversion']}, {'name': 'variableConversion', 'title': '变量名转换', 'cat': ['conversion']}, + {'name': 'jwt', 'title': 'jwt解码', 'cat': ['conversion']}, ] // 工具类功能配置 @@ -52,7 +53,8 @@ const feature = { const utools = { keyword: { hash: ['md5', 'sha1', 'sha256', 'sha512', 'sm3'], - encrypt: ['AES', 'DES', 'RC4', 'Rabbit', 'TripleDes', 'sm2'] + encrypt: ['AES', 'DES', 'RC4', 'Rabbit', 'TripleDes', 'sm2'], + jwt: ['jwtDecode'] }, cmds: { timestamp: [ diff --git a/src/tool.router.js b/src/tool.router.js index 0730e39..31a7805 100644 --- a/src/tool.router.js +++ b/src/tool.router.js @@ -101,6 +101,10 @@ const routes = [ { path: '/tool/variableConversion', component: r => require(['./views/tool/variableConversion.vue'], r) + }, + { + path: '/tool/jwt', + component: r => require(['./views/tool/jwt.vue'], r) } ] diff --git a/src/views/tool/jwt.vue b/src/views/tool/jwt.vue index 8bb107c..fd9d246 100644 --- a/src/views/tool/jwt.vue +++ b/src/views/tool/jwt.vue @@ -1,71 +1,62 @@ + \ No newline at end of file -- GitLab