add MediaInfo接口添加错误判断

This commit is contained in:
SummerTail 2023-07-02 00:32:27 +08:00
parent 138dbf542f
commit 0c010beb54

View File

@ -15,9 +15,11 @@ router.get("/getMediaInfo", async (ctx) => {
await getMediaInfo(url).then(value => { await getMediaInfo(url).then(value => {
data = value; data = value;
}) })
let verify = (data.media === null)
console.info(verify)
ctx.body = { ctx.body = {
code: 0, code: verify ? -1 : 0,
msg: "", msg: verify ? "读取文件失败" : "",
data: data data: data
} }
}) })