fix: 地震速报报错 (#6366)

This commit is contained in:
Ethan Shen
2020-12-06 18:18:54 +00:00
committed by GitHub
parent 44e9c3fa67
commit eb25cda327
+1 -1
View File
@@ -37,7 +37,7 @@ module.exports = async (ctx) => {
const typeName = typeMappings[type];
const response = await got(api);
const data = response.data;
const data = response.data.replace(/,"page":"(.*?)","num":/, ',"num":');
let json = JSON.parse(data.substring(1, data.length - 1)).shuju;
if (json.length > 20) {
json = json.slice(0, 20);