console.log(video)
var
url = config.qiniu.video + video.qiniu_key
robot
.uploadToCloudinary(url)
.then(
function
(data){
if
(data && data.public_id){
video.public_id = data.public_id
video.detail = data
video.save().then(
function
(_video){
asyncMedia(_video._id )
})
}
})
.
catch
((err) => {
console.log(err)
})
this
.body = {
success:
true
,
data: video._id
}
api key secret 我检查了是我自己账号的
打印了video
zhoujialindembp:imoocServer shadow$ node app
Listening: 1234
<-- POST /api/signature
--> POST /api/signature 200 62ms 319b
<-- POST /api/creations/video
{ __v: 0,
author: 580383804be040367c11643e,
qiniu_key:
'243974bb-766a-47c2-a407-df83c4adae64.mp4'
,
persistentId:
'z0.581f39df45a2655db7826c40'
,
_id: 581f39df4226b5dc59e94efb,
meta:
{ updateAt: Sun Nov 06 2016 22:10:39 GMT+0800 (CST),
createAt: Sun Nov 06 2016 22:10:39 GMT+0800 (CST) } }
--> POST /api/creations/video 200 105ms 50b
{ error:
{ [Error: ENOENT: no such file or directory, open
'ofuein66v.bkt.clouddn.com243974bb-766a-47c2-a407-df83c4adae64.mp4'
]
errno: -2,
code:
'ENOENT'
,
syscall:
'open'
,
path:
'ofuein66v.bkt.clouddn.com243974bb-766a-47c2-a407-df83c4adae64.mp4'
} }