svip-jwt
v1.1.0
Published
```javascript //引入包 var jwt = require("svip-jwt"); //或者用es6引入 import jwt from "svip-jwt"; //你要进行编码的源 let payload = {username:"aaa"}; //你要使用的密钥 let secret = "secret"; //进行编码 encode let token = jwt.encode(payload,secret);
Downloads
2
Readme
Usage?
//引入包
var jwt = require("svip-jwt");
//或者用es6引入
import jwt from "svip-jwt";
//你要进行编码的源
let payload = {username:"aaa"};
//你要使用的密钥
let secret = "secret";
//进行编码 encode
let token = jwt.encode(payload,secret);
console.log(token);
//进行解码 decode
payload = jwt.decode(token,secret);
console.log(payload);