modify banner data format

This commit is contained in:
Nzix 2018-05-04 20:47:50 +08:00
parent f454beb902
commit 9a6bd2a33f

View File

@ -19,7 +19,7 @@ router.get("/", (req, res) => {
try {
const pattern = /<script[^>]*>\s*window\.Gbanners\s*=\s*([^;]+?);\s*<\/script>/g;
const banners = pattern.exec(body)[1];
res.send(JSON.stringify(eval(banners)));
res.send(JSON.stringify(eval(`({code:200,banners:${banners}})`)));
} catch (error) {
res.status(502).send("fetch error");
}