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

fix: set bridge cache key error

上级 308e3594
...@@ -31,13 +31,13 @@ async function saveQQUserKey ({ ...@@ -31,13 +31,13 @@ async function saveQQUserKey ({
const keyObj = { const keyObj = {
dcloudAppid: appId, dcloudAppid: appId,
openid, openid,
platform: qqPlatform + '-weixin' platform: 'qq-' + qqPlatform
} }
switch (qqPlatform) { switch (qqPlatform) {
case 'mp': case 'mp':
await this.uniOpenBridge.setSessionKey(keyObj, { await this.uniOpenBridge.setSessionKey(keyObj, {
session_key: sessionKey session_key: sessionKey
}) }, 30 * 24 * 60 * 60)
break break
case 'app': case 'app':
case 'h5': case 'h5':
......
...@@ -63,13 +63,13 @@ async function saveWeixinUserKey ({ ...@@ -63,13 +63,13 @@ async function saveWeixinUserKey ({
const keyObj = { const keyObj = {
dcloudAppid: appId, dcloudAppid: appId,
openid, openid,
platform: weixinPlatform + '-weixin' platform: 'weixin-' + weixinPlatform
} }
switch (weixinPlatform) { switch (weixinPlatform) {
case 'mp': case 'mp':
await this.uniOpenBridge.setSessionKey(keyObj, { await this.uniOpenBridge.setSessionKey(keyObj, {
session_key: sessionKey session_key: sessionKey
}) }, 30 * 24 * 60 * 60)
break break
case 'app': case 'app':
case 'h5': case 'h5':
......
...@@ -106,7 +106,7 @@ module.exports = async function (params = {}) { ...@@ -106,7 +106,7 @@ module.exports = async function (params = {}) {
openid openid
}) })
// eslint-disable-next-line n/no-deprecated-api // eslint-disable-next-line n/no-deprecated-api
const avatarPath = url.parse(avatar).pathname const avatarPath = url.parse(avatar).pathname
const extName = avatarPath.indexOf('.') > -1 ? url.parse(avatar).pathname.split('.').pop() : 'jpg' const extName = avatarPath.indexOf('.') > -1 ? url.parse(avatar).pathname.split('.').pop() : 'jpg'
const cloudPath = `user/avatar/${openid.slice(-8) + Date.now()}-avatar.${extName}` const cloudPath = `user/avatar/${openid.slice(-8) + Date.now()}-avatar.${extName}`
const getAvatarRes = await uniCloud.httpclient.request(avatar) const getAvatarRes = await uniCloud.httpclient.request(avatar)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册