rename envi to envar
This commit is contained in:
		
							parent
							
								
									4c807cf458
								
							
						
					
					
						commit
						1b1ef70049
					
				| @ -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) { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user