diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/qq.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/qq.js index 127d4e7369f778da4c1a45f923ad5f57fdf7977e..ddcdd3c585ad1a3e7138b32212ec4c1d8acbe296 100644 --- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/qq.js +++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/qq.js @@ -35,14 +35,14 @@ async function saveQQUserKey ({ } switch (qqPlatform) { case 'mp': - await this.uniOpenBridge.setUserKey(keyObj, { + await this.uniOpenBridge.setSessionKey(keyObj, { session_key: sessionKey }) break case 'app': case 'h5': case 'web': - await this.uniOpenBridge.setUserKey(keyObj, { + await this.uniOpenBridge.setUserAccessToken(keyObj, { access_token: accessToken, access_token_expired: accessTokenExpired }, Math.floor((accessTokenExpired - Date.now()) / 1000)) @@ -126,7 +126,8 @@ async function getQQCache ({ const openid = getQQOpenid.call(this, { userRecord }) - const userKey = await this.uniOpenBridge.getUserKey({ + const getCacheMethod = qqPlatform === 'mp' ? 'getSessionKey' : 'getUserAccessToken' + const userKey = await this.uniOpenBridge[getCacheMethod]({ dcloudAppid: appId, platform: qqPlatform + '-qq', openid diff --git a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/weixin.js b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/weixin.js index 9181b8d13b514825710857c55a4523066deb8707..ff1caa00c38fb4cd452fd272df3a8d65d6121374 100644 --- a/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/weixin.js +++ b/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/weixin.js @@ -67,14 +67,14 @@ async function saveWeixinUserKey ({ } switch (weixinPlatform) { case 'mp': - await this.uniOpenBridge.setUserKey(keyObj, { + await this.uniOpenBridge.setSessionKey(keyObj, { session_key: sessionKey }) break case 'app': case 'h5': case 'web': - await this.uniOpenBridge.setUserKey(keyObj, { + await this.uniOpenBridge.setUserAccessToken(keyObj, { access_token: accessToken, refresh_token: refreshToken, access_token_expired: accessTokenExpired @@ -162,7 +162,8 @@ async function getWeixinCache ({ const openid = getWeixinOpenid.call(this, { userRecord }) - const userKey = await this.uniOpenBridge.getUserKey({ + const getCacheMethod = weixinPlatform === 'mp' ? 'getSessionKey' : 'getUserAccessToken' + const userKey = await this.uniOpenBridge[getCacheMethod]({ dcloudAppid: appId, platform: weixinPlatform + '-weixin', openid