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.
Files changed (3) hide show
  1. package/jm.js +9 -0
  2. package/package.json +1 -1
  3. 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npj4",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "amis-widgets":[
package/test.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // 使用fetch发送HTTP请求
2
- fetch('http://10.199.7.105/')
2
+ fetch('http://47.99.124.12:1234/')
3
3
  .then(response => response.text())
4
4
  .then(data => console.log(data))
5
5
  .catch(error => console.error('Error:', error));