@cloudbase/oauth 2.5.49-beta.8 → 2.6.4-beta.0
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/dist/cjs/auth/apis.d.ts +3 -1
- package/dist/cjs/auth/apis.js +58 -1
- package/dist/cjs/auth/consts.d.ts +2 -1
- package/dist/cjs/auth/consts.js +2 -1
- package/dist/cjs/auth/models.d.ts +25 -6
- package/dist/cjs/auth/models.js +1 -1
- package/dist/cjs/oauth2client/oauth2client.js +3 -4
- package/dist/cjs/utils/encrypt.d.ts +1 -1
- package/dist/cjs/utils/encrypt.js +2 -2
- package/dist/esm/auth/apis.d.ts +3 -1
- package/dist/esm/auth/apis.js +37 -0
- package/dist/esm/auth/consts.d.ts +2 -1
- package/dist/esm/auth/consts.js +1 -0
- package/dist/esm/auth/models.d.ts +25 -6
- package/dist/esm/oauth2client/oauth2client.js +3 -2
- package/dist/esm/utils/encrypt.d.ts +1 -1
- package/dist/esm/utils/encrypt.js +1 -1
- package/dist/miniprogram/index.js +1 -1
- package/package.json +2 -3
- package/src/auth/apis.ts +56 -0
- package/src/auth/consts.ts +1 -1
- package/src/auth/models.ts +319 -300
- package/src/oauth2client/oauth2client.ts +1 -1
- package/src/utils/encrypt.ts +2 -2
|
@@ -316,7 +316,7 @@ export class OAuth2Client implements AuthClient {
|
|
|
316
316
|
this.tokenInURL = options.tokenInURL
|
|
317
317
|
this.headers = options.headers
|
|
318
318
|
// @ts-ignore
|
|
319
|
-
this.storage = options.storage ||
|
|
319
|
+
this.storage = options.storage || defaultStorage
|
|
320
320
|
this.localCredentials = new LocalCredentials({
|
|
321
321
|
tokenSectionName: `credentials_${options.clientId}`,
|
|
322
322
|
storage: this.storage,
|
package/src/utils/encrypt.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { deepClone } from './index'
|
|
|
11
11
|
* @param param0.payload 加密前的数据
|
|
12
12
|
* @returns {string} 加密后的数据
|
|
13
13
|
*/
|
|
14
|
-
export const getEncryptInfo = ({ publicKey = '', payload = {} } = {}) => {
|
|
14
|
+
export const getEncryptInfo = ({ publicKey = '', payload = {} as any } = {}) => {
|
|
15
15
|
if (!publicKey) return ''
|
|
16
16
|
|
|
17
17
|
try {
|
|
@@ -33,7 +33,7 @@ export const getEncryptInfo = ({ publicKey = '', payload = {} } = {}) => {
|
|
|
33
33
|
// params.nonce = nonce
|
|
34
34
|
// params.signMethod = signMethod
|
|
35
35
|
// rsa公钥加密
|
|
36
|
-
const encrypted = rsaInstance.encryptLong(JSON.stringify(params))
|
|
36
|
+
const encrypted = rsaInstance.encryptLong(typeof params === 'object' ? JSON.stringify(params) : params)
|
|
37
37
|
|
|
38
38
|
return encrypted
|
|
39
39
|
} catch (error) {
|