rename envi to envar

This commit is contained in:
陆柯 2022-04-03 16:19:57 +08:00
parent 4c807cf458
commit 1b1ef70049

View File

@ -5,8 +5,8 @@ const crypto = require('crypto')
const my = {}
module.exports = {
init (envi) {
my.tokenKey = envi.tokenKey
init (envar) {
my.tokenKey = envar.tokenKey
},
createToken: function (content, key) {
// content 可以是数字,非空字符串或非空对象,不可以是数组。
@ -16,7 +16,7 @@ module.exports = {
content,
crypto
.createHash('sha256')
.update(key || my.tokenKey || wo.envi.tokenKey || '', 'utf8')
.update(key || my.tokenKey || wo.envar.tokenKey || '', 'utf8')
.digest('hex')
)
} catch (exp) {
@ -29,7 +29,7 @@ module.exports = {
token,
crypto
.createHash('sha256')
.update(key || my.tokenKey || wo.envi.tokenKey || '', 'utf8')
.update(key || my.tokenKey || wo.envar.tokenKey || '', 'utf8')
.digest('hex')
)
} catch (exp) {