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
e3b20330
Commit
e3b20330
authored
May 09, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api.js
parent
15f6cf4d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
52 deletions
+1
-52
center-channel/app/config/routes/api.js
+1
-52
No files found.
center-channel/app/config/routes/api.js
View file @
e3b20330
...
...
@@ -326,58 +326,7 @@ module.exports = function (app) {
//-----------------------新的模式---------api---------结束
//----------------------飞书小程序---------------------------------------------开始
//接收appTicket信息
app
.
use
(
'/feishu/appTicket'
,
async
function
(
req
,
res
)
{
try
{
var
client_ip
=
system
.
get_client_ip
(
req
);
var
result
=
await
utilsFeishuSve
.
receiveAppTicket
(
req
.
body
);
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"飞书小程序记录回调处理结果:,method=appTicket"
,
op
:
"app/config/routes/api.js/feishu/appTicket"
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"回调结果:"
+
JSON
.
stringify
(
result
),
clientIp
:
client_ip
||
""
});
if
(
result
.
status
!=
0
)
{
return
res
.
end
(
"FAIL"
);
}
return
res
.
end
(
"success"
);
}
catch
(
error
)
{
logCtl
.
error
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"飞书小程序记录回调处理结果异常,method=appTicket"
,
op
:
"app/config/routes/api.js/feishu/appTicket"
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"error:"
+
error
.
stack
,
clientIp
:
client_ip
||
""
});
}
});
//订阅验证
app
.
use
(
'/feishu/subscribeVerification'
,
async
function
(
req
,
res
)
{
try
{
var
client_ip
=
system
.
get_client_ip
(
req
);
var
result
=
await
utilsFeishuSve
.
subscribeVerification
(
req
.
body
);
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"飞书小程序记录回调处理结果,method=subscribeVerification"
,
op
:
"app/config/routes/api.js/feishu/subscribeVerification"
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"回调结果:"
+
JSON
.
stringify
(
result
),
clientIp
:
client_ip
||
""
});
if
(
result
.
status
!=
0
)
{
return
res
.
end
(
"fail"
);
}
var
returnObj
=
{
"challenge"
:
result
.
data
,
// 应用需要原样返回的值
};
returnObj
=
JSON
.
stringify
(
returnObj
);
return
res
.
end
(
returnObj
);
}
catch
(
error
)
{
logCtl
.
error
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"飞书小程序记录回调处理结果异常:,method=subscribeVerification"
,
op
:
"app/config/routes/api.js/feishu/subscribeVerification"
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"error:"
+
error
.
stack
,
clientIp
:
client_ip
||
""
});
}
});
//飞书通知
app
.
use
(
'/feishu/notify'
,
async
function
(
req
,
res
)
{
try
{
...
...
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