@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.
@@ -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 || new DefaultStorage()
319
+ this.storage = options.storage || defaultStorage
320
320
  this.localCredentials = new LocalCredentials({
321
321
  tokenSectionName: `credentials_${options.clientId}`,
322
322
  storage: this.storage,
@@ -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) {