Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello_uni-id-pages
提交
f4e7ec75
H
hello_uni-id-pages
项目概览
DCloud
/
hello_uni-id-pages
通知
1051
Star
31
Fork
43
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
2
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello_uni-id-pages
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f4e7ec75
编写于
7月 21, 2022
作者:
雪洛
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: third party info error
上级
cc569438
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
15 deletion
+26
-15
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/qq.js
...d-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/qq.js
+10
-5
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/weixin.js
...ges/uniCloud/cloudfunctions/uni-id-co/lib/utils/weixin.js
+10
-5
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-qq.js
...niCloud/cloudfunctions/uni-id-co/module/relate/bind-qq.js
+6
-5
未找到文件。
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/qq.js
浏览文件 @
f4e7ec75
...
...
@@ -24,6 +24,7 @@ function generateQQCache ({
accessTokenExpired
// App端QQ用户accessToken过期时间
}
=
{})
{
const
platform
=
getQQPlatform
.
call
(
this
)
const
appId
=
this
.
getClientInfo
().
appId
let
cache
switch
(
platform
)
{
case
'
app
'
:
...
...
@@ -42,7 +43,7 @@ function generateQQCache ({
}
return
{
third_party
:
{
[
`
${
platform
}
_qq`
]:
cache
[
`
${
appId
}
_
${
platform
}
_qq`
]:
cache
}
}
}
...
...
@@ -53,6 +54,7 @@ async function getQQCache ({
key
}
=
{})
{
const
platform
=
getQQPlatform
.
call
(
this
)
const
appId
=
this
.
getClientInfo
().
appId
if
(
!
userRecord
)
{
const
getUserRes
=
await
userCollection
.
doc
(
uid
).
get
()
userRecord
=
getUserRes
.
data
[
0
]
...
...
@@ -62,10 +64,13 @@ async function getQQCache ({
errCode
:
ERROR
.
ACCOUNT_NOT_EXISTS
}
}
return
userRecord
&&
userRecord
.
third_party
&&
userRecord
.
third_party
[
`
${
platform
}
_qq`
]
&&
userRecord
.
third_party
[
`
${
platform
}
_qq`
][
key
]
const
thirdParty
=
userRecord
&&
userRecord
.
third_party
if
(
!
thirdParty
)
{
return
}
const
qqCacheOld
=
thirdParty
[
`
${
platform
}
_qq`
]
const
qqCache
=
thirdParty
[
`
${
appId
}
_
${
platform
}
_qq`
]
return
(
qqCache
&&
qqCache
[
key
])
||
(
qqCacheOld
&&
qqCacheOld
[
key
])
}
module
.
exports
=
{
...
...
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/weixin.js
浏览文件 @
f4e7ec75
...
...
@@ -60,6 +60,7 @@ function generateWeixinCache ({
accessTokenExpired
// App端微信用户accessToken过期时间
}
=
{})
{
const
platform
=
getWeixinPlatform
.
call
(
this
)
const
appId
=
this
.
getClientInfo
().
appId
let
cache
switch
(
platform
)
{
case
'
app
'
:
...
...
@@ -81,7 +82,7 @@ function generateWeixinCache ({
}
return
{
third_party
:
{
[
`
${
platform
}
_weixin`
]:
cache
[
`
${
appId
}
_
${
platform
}
_weixin`
]:
cache
}
}
}
...
...
@@ -92,6 +93,7 @@ async function getWeixinCache ({
key
}
=
{})
{
const
platform
=
getWeixinPlatform
.
call
(
this
)
const
appId
=
this
.
getClientInfo
().
appId
if
(
!
userRecord
)
{
const
getUserRes
=
await
userCollection
.
doc
(
uid
).
get
()
userRecord
=
getUserRes
.
data
[
0
]
...
...
@@ -101,10 +103,13 @@ async function getWeixinCache ({
errCode
:
ERROR
.
ACCOUNT_NOT_EXISTS
}
}
return
userRecord
&&
userRecord
.
third_party
&&
userRecord
.
third_party
[
`
${
platform
}
_weixin`
]
&&
userRecord
.
third_party
[
`
${
platform
}
_weixin`
][
key
]
const
thirdParty
=
userRecord
&&
userRecord
.
third_party
if
(
!
thirdParty
)
{
return
}
const
weixinCacheOld
=
thirdParty
[
`
${
platform
}
_weixin`
]
const
weixinCache
=
thirdParty
[
`
${
appId
}
_
${
platform
}
_weixin`
]
return
(
weixinCache
&&
weixinCache
[
key
])
||
(
weixinCacheOld
&&
weixinCacheOld
[
key
])
}
module
.
exports
=
{
...
...
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-qq.js
浏览文件 @
f4e7ec75
...
...
@@ -11,6 +11,9 @@ const {
const
{
initQQ
}
=
require
(
'
../../lib/third-party/index
'
)
const
{
generateQQCache
}
=
require
(
'
../../lib/utils/qq
'
)
/**
* 绑定QQ
...
...
@@ -78,11 +81,9 @@ module.exports = async function (params = {}) {
uid
,
bindAccount
,
extraData
:
{
third_party
:
{
[
clientPlatform
]:
{
session_key
:
sessionKey
}
}
...
generateQQCache
.
call
(
this
,
{
sessionKey
})
},
logType
:
LOG_TYPE
.
BIND_QQ
})
...
...
雪洛
@u013082782
mentioned in commit
5e60e9dd
·
7月 21, 2022
mentioned in commit
5e60e9dd
mentioned in commit 5e60e9ddafc28fb2f7395a1a09f45f31c57b1abe
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录