@cloudbase/oauth 2.5.49-beta.2 → 2.5.49-beta.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/oauth",
3
- "version": "2.5.49-beta.2",
3
+ "version": "2.5.49-beta.3",
4
4
  "description": "cloudbase javascript sdk auth componets",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -16,10 +16,7 @@
16
16
  "build": "npm run lint && npm run tsc",
17
17
  "precommit": "npm run lint"
18
18
  },
19
- "dependencies": {
20
- "crypto-js": "^4.2.0",
21
- "encryptlong": "^3.1.4"
22
- },
19
+ "dependencies": {},
23
20
  "license": "Apache-2.0",
24
21
  "gitHead": "0d182ece790ba8a0ef254f63f6a06ab3e878a302"
25
22
  }
@@ -1,4 +1,6 @@
1
+ // 魔改的 encryptlong 版本, 只支持 encryptLong 方法
1
2
  import JSEncrypt from './encryptlong'
3
+
2
4
  // import HmacSHA256 from 'crypto-js/hmac-sha256'
3
5
  // import WordArray from 'crypto-js/lib-typedarrays'
4
6
  import { deepClone } from '.'
@@ -15,7 +17,7 @@ export const getEncryptInfo = ({ publicKey = '', payload = {} } = {}) => {
15
17
  try {
16
18
  const params = deepClone(payload)
17
19
  // 生成RSA实例
18
- const rsaInstance = new JSEncrypt()
20
+ const rsaInstance = new JSEncrypt({})
19
21
  // 设置公钥
20
22
  rsaInstance.setPublicKey(publicKey)
21
23
  // 生成时间戳