Update index.js
Browse files
index.js
CHANGED
|
@@ -30,13 +30,13 @@ app.get('*', async (req, res) => {
|
|
| 30 |
},
|
| 31 |
data: file.data
|
| 32 |
})
|
| 33 |
-
if (upload_result.
|
| 34 |
res.send(JSON.stringify({
|
| 35 |
vid: upload_info.data.vid,
|
| 36 |
url: `https://sf16-sg-default.akamaized.net/obj/${upload_info.data.uri}`
|
| 37 |
}))
|
| 38 |
} else {
|
| 39 |
-
|
| 40 |
}
|
| 41 |
} catch (e) {
|
| 42 |
res.send(e.toString())
|
|
|
|
| 30 |
},
|
| 31 |
data: file.data
|
| 32 |
})
|
| 33 |
+
if (upload_result.data.code == 2000) {
|
| 34 |
res.send(JSON.stringify({
|
| 35 |
vid: upload_info.data.vid,
|
| 36 |
url: `https://sf16-sg-default.akamaized.net/obj/${upload_info.data.uri}`
|
| 37 |
}))
|
| 38 |
} else {
|
| 39 |
+
throw Error
|
| 40 |
}
|
| 41 |
} catch (e) {
|
| 42 |
res.send(e.toString())
|