Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
5a907b45
Commit
5a907b45
authored
May 12, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feishu
parent
cc4d8649
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
6 deletions
+10
-6
center-channel/app/base/db/cache/feishuAppAccessTokenCache.js
+5
-2
center-channel/app/base/db/cache/feishuAppTicketCache.js
+2
-2
center-channel/app/base/service/impl/common/feishuLoginSve.js
+1
-1
center-channel/app/base/service/impl/utilsSve/utilsFeishuSve.js
+1
-1
center-channel/app/base/utils/execClient.js
+1
-0
No files found.
center-channel/app/base/db/cache/feishuAppAccessTokenCache.js
View file @
5a907b45
...
@@ -21,10 +21,13 @@ class feishuAppAccessTokenCache extends CacheBase{
...
@@ -21,10 +21,13 @@ class feishuAppAccessTokenCache extends CacheBase{
var
result
=
await
this
.
redisClient
.
get
(
key
);
var
result
=
await
this
.
redisClient
.
get
(
key
);
return
result
;
return
result
;
}
}
async
set
(
accessToken
){
async
set
(
accessToken
,
expire
){
if
(
!
expire
){
expire
=
7100
;
}
var
key
=
this
.
prefix
;
var
key
=
this
.
prefix
;
if
(
accessToken
){
if
(
accessToken
){
await
this
.
redisClient
.
setWithEx
(
key
,
accessToken
,
7100
);
await
this
.
redisClient
.
setWithEx
(
key
,
accessToken
,
expire
);
}
}
return
accessToken
;
return
accessToken
;
}
}
...
...
center-channel/app/base/db/cache/feishuAppTicketCache.js
View file @
5a907b45
...
@@ -2,7 +2,7 @@ const CacheBase=require("../cache.base");
...
@@ -2,7 +2,7 @@ const CacheBase=require("../cache.base");
const
system
=
require
(
"../../system"
);
const
system
=
require
(
"../../system"
);
// const OpenplatformWxop = require("../../wxop/impl/openplatformWxop");
// const OpenplatformWxop = require("../../wxop/impl/openplatformWxop");
/**
/**
* 飞书小程序--AppTicket缓存--有效时间3
5
00s
* 飞书小程序--AppTicket缓存--有效时间3
6
00s
*/
*/
class
feishuAppTicketCache
extends
CacheBase
{
class
feishuAppTicketCache
extends
CacheBase
{
constructor
(){
constructor
(){
...
@@ -24,7 +24,7 @@ class feishuAppTicketCache extends CacheBase{
...
@@ -24,7 +24,7 @@ class feishuAppTicketCache extends CacheBase{
async
set
(
appTicket
){
async
set
(
appTicket
){
var
key
=
this
.
prefix
;
var
key
=
this
.
prefix
;
if
(
appTicket
){
if
(
appTicket
){
await
this
.
redisClient
.
setWithEx
(
key
,
appTicket
,
3
5
00
);
await
this
.
redisClient
.
setWithEx
(
key
,
appTicket
,
3
6
00
);
}
}
return
appTicket
;
return
appTicket
;
}
}
...
...
center-channel/app/base/service/impl/common/feishuLoginSve.js
View file @
5a907b45
...
@@ -59,7 +59,7 @@ class feishuLoginService{
...
@@ -59,7 +59,7 @@ class feishuLoginService{
}
catch
(
e
)
{
}
catch
(
e
)
{
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
return
system
.
getResultFail
(
-
200
,
e
.
stack
);
}
}
return
system
.
getResultFail
(
"获取userpin失败"
);
return
system
.
getResultFail
(
-
100
,
"获取userpin失败"
);
}
}
//渠道通过账户进行登录,有则返回用户信息,没有则创建用户------>供后端调用
//渠道通过账户进行登录,有则返回用户信息,没有则创建用户------>供后端调用
...
...
center-channel/app/base/service/impl/utilsSve/utilsFeishuSve.js
View file @
5a907b45
...
@@ -99,7 +99,7 @@ class UtilsFeishuService{
...
@@ -99,7 +99,7 @@ class UtilsFeishuService{
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
result
.
code
==
0
&&
result
.
app_access_token
){
if
(
result
.
code
==
0
&&
result
.
app_access_token
){
//缓存AppAccessToken
//缓存AppAccessToken
await
this
.
cacheManager
[
"feishuAppAccessTokenCache"
].
set
(
result
.
app_access_token
);
await
this
.
cacheManager
[
"feishuAppAccessTokenCache"
].
set
(
result
.
app_access_token
,
result
.
expire
);
return
system
.
getResultSuccess
(
result
.
app_access_token
);
return
system
.
getResultSuccess
(
result
.
app_access_token
);
}
}
return
system
.
getResultFail
(
"获取appAccessToken失败"
);
return
system
.
getResultFail
(
"获取appAccessToken失败"
);
...
...
center-channel/app/base/utils/execClient.js
View file @
5a907b45
...
@@ -63,6 +63,7 @@ class ExecClient {
...
@@ -63,6 +63,7 @@ class ExecClient {
console
.
log
(
cmd
);
console
.
log
(
cmd
);
return
cmd
;
return
cmd
;
}
}
//飞书小程序GET请求
FetchFeishuGetCmd
(
subData
,
url
)
{
FetchFeishuGetCmd
(
subData
,
url
)
{
var
cmd
=
this
.
cmdFeishuGetPattern
.
replace
(
var
cmd
=
this
.
cmdFeishuGetPattern
.
replace
(
/
\{
data
\}
/g
,
subData
).
replace
(
/
\{
url
\}
/g
,
url
).
replace
(
/
\{
Authorization
\}
/g
,
"Bearer "
+
subData
.
user_access_token
);
/
\{
data
\}
/g
,
subData
).
replace
(
/
\{
url
\}
/g
,
url
).
replace
(
/
\{
Authorization
\}
/g
,
"Bearer "
+
subData
.
user_access_token
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment