rename envi to envar
This commit is contained in:
parent
4c807cf458
commit
1b1ef70049
@ -5,8 +5,8 @@ const crypto = require('crypto')
|
|||||||
const my = {}
|
const my = {}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
init (envi) {
|
init (envar) {
|
||||||
my.tokenKey = envi.tokenKey
|
my.tokenKey = envar.tokenKey
|
||||||
},
|
},
|
||||||
createToken: function (content, key) {
|
createToken: function (content, key) {
|
||||||
// content 可以是数字,非空字符串或非空对象,不可以是数组。
|
// content 可以是数字,非空字符串或非空对象,不可以是数组。
|
||||||
@ -16,7 +16,7 @@ module.exports = {
|
|||||||
content,
|
content,
|
||||||
crypto
|
crypto
|
||||||
.createHash('sha256')
|
.createHash('sha256')
|
||||||
.update(key || my.tokenKey || wo.envi.tokenKey || '', 'utf8')
|
.update(key || my.tokenKey || wo.envar.tokenKey || '', 'utf8')
|
||||||
.digest('hex')
|
.digest('hex')
|
||||||
)
|
)
|
||||||
} catch (exp) {
|
} catch (exp) {
|
||||||
@ -29,7 +29,7 @@ module.exports = {
|
|||||||
token,
|
token,
|
||||||
crypto
|
crypto
|
||||||
.createHash('sha256')
|
.createHash('sha256')
|
||||||
.update(key || my.tokenKey || wo.envi.tokenKey || '', 'utf8')
|
.update(key || my.tokenKey || wo.envar.tokenKey || '', 'utf8')
|
||||||
.digest('hex')
|
.digest('hex')
|
||||||
)
|
)
|
||||||
} catch (exp) {
|
} catch (exp) {
|
||||||
|
Loading…
Reference in New Issue
Block a user