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

fix: third party openid error

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