diff --git a/docs/travel.md b/docs/travel.md
index 47ae09ac61..e74f9df314 100644
--- a/docs/travel.md
+++ b/docs/travel.md
@@ -12,7 +12,7 @@ pageClass: routes
### 售票信息
-
+
## All the Flight Deals
diff --git a/lib/v2/12306/index.js b/lib/v2/12306/index.js
index 84e0f53b34..8f9d14c75a 100644
--- a/lib/v2/12306/index.js
+++ b/lib/v2/12306/index.js
@@ -61,11 +61,11 @@ module.exports = async (ctx) => {
Cookie: await getJSESSIONID(linkUrl),
},
});
- const data = response.data.data.result;
- const map = response.data.data.map;
- if (data.length === 0) {
+ if (response.data.data === undefined || response.data.data.length === 0) {
throw '没有找到相关车次,请检查参数是否正确';
}
+ const data = response.data.data.result;
+ const map = response.data.data.map;
const items = data.map((item) => {
const itemData = item.split('|');
@@ -96,7 +96,7 @@ module.exports = async (ctx) => {
trainInfo,
}),
link: linkUrl,
- guid: item,
+ guid: Object.values(trainInfo).join('|'),
};
});