npj4 1.0.12 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/jm.js +9 -0
- package/package.json +1 -1
- package/test.js +1 -1
package/jm.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const jwt = require('jsonwebtoken');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const privateKey = fs.readFileSync('C:/Users/非攻墨门/Downloads/aisuda-key(2)/aisuda.key'); // 这里要用应用级别的密钥
|
|
4
|
+
const token = jwt.sign({companyKey: '59b83', appKey: '02bb7705766b'}, privateKey, {
|
|
5
|
+
algorithm: 'RS256'
|
|
6
|
+
}); // 请修改这里的 xxx 和 yyy
|
|
7
|
+
|
|
8
|
+
const Authorization = 'Bearer ' + token;
|
|
9
|
+
console.log(Authorization);
|
package/package.json
CHANGED
package/test.js
CHANGED