fix(route): item's desc is same but guid is different (#9042)
fix(route): 12306 item's desc is same but guid is different
This commit is contained in:
+1
-1
@@ -12,7 +12,7 @@ pageClass: routes
|
||||
|
||||
### 售票信息
|
||||
|
||||
<Route author="Fatpandac" example="/12306/2022-02-19/重庆/永川东" path="/12306/:date/:from/:to/:type?" :paramsDesc="['时间', '始发站', '终点站', '售票类型,成人和学生可选,默认为成人']"/>
|
||||
<Route author="Fatpandac" example="/12306/2022-02-19/重庆/永川东" path="/12306/:date/:from/:to/:type?" :paramsDesc="['时间,格式为(YYYY-MM-DD)', '始发站', '终点站', '售票类型,成人和学生可选,默认为成人']"/>
|
||||
|
||||
## All the Flight Deals
|
||||
|
||||
|
||||
@@ -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('|'),
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user