(text)
| 17 | } |
| 18 | |
| 19 | const sha256Encrypt = (text) => { |
| 20 | if (typeof text !== 'string') { |
| 21 | logger.error('输入必须是字符串类型', 'TOOLS') |
| 22 | throw new Error('输入必须是字符串类型') |
| 23 | } |
| 24 | const hash = crypto.createHash('sha256') |
| 25 | hash.update(text, 'utf-8') |
| 26 | return hash.digest('hex') |
| 27 | } |
| 28 | |
| 29 | const JwtDecode = (token) => { |
| 30 | try { |
no test coverage detected