Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello_uni-id-pages
提交
7e6fecb6
H
hello_uni-id-pages
项目概览
DCloud
/
hello_uni-id-pages
通知
1068
Star
33
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看板
提交
7e6fecb6
编写于
8月 12, 2022
作者:
雪洛
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: set user access token, set session key
上级
1122a86c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
6 deletion
+8
-6
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
+4
-3
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/weixin.js
...ges/uniCloud/cloudfunctions/uni-id-co/lib/utils/weixin.js
+4
-3
未找到文件。
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/qq.js
浏览文件 @
7e6fecb6
...
...
@@ -35,14 +35,14 @@ async function saveQQUserKey ({
}
switch
(
qqPlatform
)
{
case
'
mp
'
:
await
this
.
uniOpenBridge
.
set
User
Key
(
keyObj
,
{
await
this
.
uniOpenBridge
.
set
Session
Key
(
keyObj
,
{
session_key
:
sessionKey
})
break
case
'
app
'
:
case
'
h5
'
:
case
'
web
'
:
await
this
.
uniOpenBridge
.
setUser
Key
(
keyObj
,
{
await
this
.
uniOpenBridge
.
setUser
AccessToken
(
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
...
...
uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/weixin.js
浏览文件 @
7e6fecb6
...
...
@@ -67,14 +67,14 @@ async function saveWeixinUserKey ({
}
switch
(
weixinPlatform
)
{
case
'
mp
'
:
await
this
.
uniOpenBridge
.
set
User
Key
(
keyObj
,
{
await
this
.
uniOpenBridge
.
set
Session
Key
(
keyObj
,
{
session_key
:
sessionKey
})
break
case
'
app
'
:
case
'
h5
'
:
case
'
web
'
:
await
this
.
uniOpenBridge
.
setUser
Key
(
keyObj
,
{
await
this
.
uniOpenBridge
.
setUser
AccessToken
(
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
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录