Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
付智勇
/
koa2_Sequelize_project
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
付智勇
8 years ago
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
36ce27adf208a8b9a5899ce6af73020a05a675d6
36ce27ad
1 parent
93c953cd
录制回放
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
33 行增加
和
12 行删除
routes/users.js
util/Agora_Recording_SDK_for_Linux_FULL/samples/shellUtil.js
util/filterUrl.js
routes/users.js
查看文件 @
36ce27a
...
...
@@ -2,6 +2,7 @@ const router = require('koa-router')()
var
userContoller
=
require
(
'../controller/userController'
)
var
status
=
require
(
'../util/resTemplate'
)
const
inspectMediaChannelKey
=
require
(
'../util/inspectMediaChannelKey'
)
const
shellUtil
=
require
(
'../util/Agora_Recording_SDK_for_Linux_FULL/samples/shellUtil'
)
router
.
prefix
(
'/users'
)
...
...
@@ -125,4 +126,21 @@ router.post('/encryptionToken',async (ctx, next) => {
})
/**
*
*/
router
.
post
(
'/Recording'
,
async
(
ctx
,
next
)
=>
{
try
{
let
body
=
ctx
.
request
.
body
;
console
.
log
()
let
Recording
=
await
shellUtil
.
Recording
(
body
.
appID
,
body
.
uid
,
body
.
channel
,
body
.
channelKey
)
ctx
.
response
.
status
=
200
;
ctx
.
response
.
body
=
{
msg
:
Recording
};
}
catch
(
e
){
console
.
log
(
e
)
status
.
catchError
(
ctx
,
400
,
e
.
message
);
}
})
module
.
exports
=
router
...
...
util/Agora_Recording_SDK_for_Linux_FULL/samples/shellUtil.js
查看文件 @
36ce27a
...
...
@@ -5,19 +5,22 @@ function shell(){
}
shell
.
prototype
.
Recording
=
async
(
appId
,
uid
,
channel
)
=>
{
try
{
shell
.
prototype
.
Recording
=
async
(
appId
,
uid
,
channel
,
channelKey
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
shell
=
`
.
/
RECORD_APP
`
+
`
--
appId
`
+
appId
`
--
uid
`
+
uid
`
--
channel
`
+
channel
`
--
appId
`
+
appId
+
`
--
uid
`
+
uid
+
`
--
channel
`
+
channel
+
`
--
channelKey
`
+
channelKey
+
" --appliteDir \`pwd\`/../bin"
;
let
backShell
=
callfile
.
exec
(
shell
);
return
backShell
;
}
catch
(
error
)
{
throw
error
}
callfile
.
exec
(
shell
,
function
(
err
,
stdout
,
stderr
){
console
.
log
(
arguments
);
if
(
err
){
reject
(
err
);
}
resolve
(
arguments
);
})
})
}
...
...
util/filterUrl.js
查看文件 @
36ce27a
module
.
exports
=
[
'/'
,
"/users/addUser"
,
"/users/login"
,
'/users/addUser?time=1'
,
'/users/encryptionToken'
]
\ No newline at end of file
module
.
exports
=
[
'/'
,
"/users/addUser"
,
"/users/login"
,
'/users/addUser?time=1'
,
'/users/encryptionToken'
,
'/users/Recording'
]
\ No newline at end of file
...
...
请
注册
或
登录
后发表评论