提交 5e60e9dd 编写于 作者: 雪洛's avatar 雪洛

fix: third party openid error

This reverts commit f4e7ec75.
上级 f4e7ec75
...@@ -19,6 +19,7 @@ function getQQPlatform () { ...@@ -19,6 +19,7 @@ function getQQPlatform () {
} }
function generateQQCache ({ function generateQQCache ({
openid,
sessionKey, // QQ小程序用户sessionKey sessionKey, // QQ小程序用户sessionKey
accessToken, // App端QQ用户accessToken accessToken, // App端QQ用户accessToken
accessTokenExpired // App端QQ用户accessToken过期时间 accessTokenExpired // App端QQ用户accessToken过期时间
...@@ -29,12 +30,14 @@ function generateQQCache ({ ...@@ -29,12 +30,14 @@ function generateQQCache ({
switch (platform) { switch (platform) {
case 'app': case 'app':
cache = { cache = {
openid,
access_token: accessToken, access_token: accessToken,
access_token_expired: accessTokenExpired access_token_expired: accessTokenExpired
} }
break break
case 'mp': case 'mp':
cache = { cache = {
openid,
session_key: sessionKey session_key: sessionKey
} }
break break
......
...@@ -54,6 +54,7 @@ function getWeixinPlatform () { ...@@ -54,6 +54,7 @@ function getWeixinPlatform () {
} }
function generateWeixinCache ({ function generateWeixinCache ({
openid,
sessionKey, // 微信小程序用户sessionKey sessionKey, // 微信小程序用户sessionKey
accessToken, // App端微信用户accessToken accessToken, // App端微信用户accessToken
refreshToken, // App端微信用户refreshToken refreshToken, // App端微信用户refreshToken
...@@ -67,6 +68,7 @@ function generateWeixinCache ({ ...@@ -67,6 +68,7 @@ function generateWeixinCache ({
case 'h5': case 'h5':
case 'web': case 'web':
cache = { cache = {
openid,
access_token: accessToken, access_token: accessToken,
refresh_token: refreshToken, refresh_token: refreshToken,
access_token_expired: accessTokenExpired access_token_expired: accessTokenExpired
...@@ -74,6 +76,7 @@ function generateWeixinCache ({ ...@@ -74,6 +76,7 @@ function generateWeixinCache ({
break break
case 'mp': case 'mp':
cache = { cache = {
openid,
session_key: sessionKey session_key: sessionKey
} }
break break
......
...@@ -137,6 +137,7 @@ module.exports = async function (params = {}) { ...@@ -137,6 +137,7 @@ module.exports = async function (params = {}) {
extraData: { extraData: {
...extraData, ...extraData,
...generateQQCache.call(this, { ...generateQQCache.call(this, {
openid,
sessionKey, // QQ小程序用户sessionKey sessionKey, // QQ小程序用户sessionKey
accessToken, // App端QQ用户accessToken accessToken, // App端QQ用户accessToken
accessTokenExpired // App端QQ用户accessToken过期时间 accessTokenExpired // App端QQ用户accessToken过期时间
......
...@@ -124,6 +124,7 @@ module.exports = async function (params = {}) { ...@@ -124,6 +124,7 @@ module.exports = async function (params = {}) {
extraData: { extraData: {
...extraData, ...extraData,
...generateWeixinCache.call(this, { ...generateWeixinCache.call(this, {
openid,
sessionKey, // 微信小程序用户sessionKey sessionKey, // 微信小程序用户sessionKey
accessToken, // App端微信用户accessToken accessToken, // App端微信用户accessToken
refreshToken, // App端微信用户refreshToken refreshToken, // App端微信用户refreshToken
......
...@@ -82,6 +82,7 @@ module.exports = async function (params = {}) { ...@@ -82,6 +82,7 @@ module.exports = async function (params = {}) {
bindAccount, bindAccount,
extraData: { extraData: {
...generateQQCache.call(this, { ...generateQQCache.call(this, {
openid,
sessionKey sessionKey
}) })
}, },
......
...@@ -73,6 +73,7 @@ module.exports = async function (params = {}) { ...@@ -73,6 +73,7 @@ module.exports = async function (params = {}) {
bindAccount, bindAccount,
extraData: { extraData: {
...generateWeixinCache.call(this, { ...generateWeixinCache.call(this, {
openid,
sessionKey, // 微信小程序用户sessionKey sessionKey, // 微信小程序用户sessionKey
accessToken, // App端微信用户accessToken accessToken, // App端微信用户accessToken
refreshToken, // App端微信用户refreshToken refreshToken, // App端微信用户refreshToken
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册