|
|
|
@ -185,6 +185,7 @@ |
|
|
|
console.log('没有搜索', searchName.value); |
|
|
|
handleDefault() |
|
|
|
} else { |
|
|
|
if (currentIndex.value == 0) { |
|
|
|
console.log('搜索', searchName.value); |
|
|
|
const result = await getModel1First({ |
|
|
|
content: searchName.value, |
|
|
|
@ -201,8 +202,8 @@ |
|
|
|
stockId.value = result.data.stockId |
|
|
|
language.value = result.data.language |
|
|
|
market.value = result.data.market |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const res = await getModel1Second({ |
|
|
|
language: language.value, |
|
|
|
recordId: recordId.value, |
|
|
|
@ -218,16 +219,152 @@ |
|
|
|
htmlContent.value = marked.parse(markdownContent.value); |
|
|
|
} |
|
|
|
console.log('res', res); |
|
|
|
|
|
|
|
|
|
|
|
await getServerData() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (result.code == 400) { |
|
|
|
markdownContent.value = result.message; |
|
|
|
htmlContent.value = marked.parse(markdownContent.value); |
|
|
|
} else { |
|
|
|
return |
|
|
|
} |
|
|
|
} else if (currentIndex.value == 1) { |
|
|
|
console.log('搜索', searchName.value); |
|
|
|
const result = await getModel2First({ |
|
|
|
content: searchName.value, |
|
|
|
language: "cn", |
|
|
|
marketList: "hk,cn,usa,my,sg,vi,in,gb", |
|
|
|
model: currentIndex.value + 1 |
|
|
|
}) |
|
|
|
console.log('result', result); |
|
|
|
if (result.code == 200) { |
|
|
|
stockCode.value = result.data.code |
|
|
|
// stockName.value = result.data.name |
|
|
|
recordId.value = result.data.recordId |
|
|
|
parentId.value = result.data.parentId |
|
|
|
stockId.value = result.data.stockId |
|
|
|
language.value = result.data.language |
|
|
|
market.value = result.data.market |
|
|
|
|
|
|
|
|
|
|
|
const res = await getModel2Second({ |
|
|
|
language: language.value, |
|
|
|
recordId: recordId.value, |
|
|
|
parentId: parentId.value, |
|
|
|
stockId: stockId.value, |
|
|
|
token: 'pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q' |
|
|
|
}) |
|
|
|
if (res.code == 200) { |
|
|
|
const rawMarkdown = res.data.markdown; |
|
|
|
const adaptedMarkdown = rawMarkdown.replace(/^### /gm, ''); // 全局替换行首的### |
|
|
|
markdownContent.value = adaptedMarkdown; |
|
|
|
// markdownContent.value = res.data.markdown |
|
|
|
htmlContent.value = marked.parse(markdownContent.value); |
|
|
|
} |
|
|
|
console.log('res', res); |
|
|
|
|
|
|
|
await getServerData() |
|
|
|
|
|
|
|
|
|
|
|
} else if (result.code == 400) { |
|
|
|
markdownContent.value = result.message; |
|
|
|
htmlContent.value = marked.parse(markdownContent.value); |
|
|
|
} else { |
|
|
|
return |
|
|
|
} |
|
|
|
}else if(currentIndex.value == 2){ |
|
|
|
console.log('搜索', searchName.value); |
|
|
|
const result = await getModel3First({ |
|
|
|
content: searchName.value, |
|
|
|
language: "cn", |
|
|
|
marketList: "hk,cn,usa,my,sg,vi,in,gb", |
|
|
|
model: currentIndex.value + 1 |
|
|
|
}) |
|
|
|
console.log('result', result); |
|
|
|
if (result.code == 200) { |
|
|
|
stockCode.value = result.data.code |
|
|
|
// stockName.value = result.data.name |
|
|
|
recordId.value = result.data.recordId |
|
|
|
parentId.value = result.data.parentId |
|
|
|
stockId.value = result.data.stockId |
|
|
|
language.value = result.data.language |
|
|
|
market.value = result.data.market |
|
|
|
|
|
|
|
|
|
|
|
const res = await getModel3Second({ |
|
|
|
language: language.value, |
|
|
|
recordId: recordId.value, |
|
|
|
parentId: parentId.value, |
|
|
|
stockId: stockId.value, |
|
|
|
token: 'pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q' |
|
|
|
}) |
|
|
|
if (res.code == 200) { |
|
|
|
const rawMarkdown = res.data.markdown; |
|
|
|
const adaptedMarkdown = rawMarkdown.replace(/^### /gm, ''); // 全局替换行首的### |
|
|
|
markdownContent.value = adaptedMarkdown; |
|
|
|
// markdownContent.value = res.data.markdown |
|
|
|
htmlContent.value = marked.parse(markdownContent.value); |
|
|
|
} |
|
|
|
console.log('res', res); |
|
|
|
|
|
|
|
await getServerData() |
|
|
|
|
|
|
|
|
|
|
|
} else if (result.code == 400) { |
|
|
|
markdownContent.value = result.message; |
|
|
|
htmlContent.value = marked.parse(markdownContent.value); |
|
|
|
} else { |
|
|
|
return |
|
|
|
} |
|
|
|
}else if(currentIndex.value == 3){ |
|
|
|
console.log('搜索', searchName.value); |
|
|
|
const result = await getModel4First({ |
|
|
|
content: searchName.value, |
|
|
|
language: "cn", |
|
|
|
marketList: "hk,cn,usa,my,sg,vi,in,gb", |
|
|
|
model: currentIndex.value + 1 |
|
|
|
}) |
|
|
|
console.log('result', result); |
|
|
|
if (result.code == 200) { |
|
|
|
stockCode.value = result.data.code |
|
|
|
// stockName.value = result.data.name |
|
|
|
recordId.value = result.data.recordId |
|
|
|
parentId.value = result.data.parentId |
|
|
|
stockId.value = result.data.stockId |
|
|
|
language.value = result.data.language |
|
|
|
market.value = result.data.market |
|
|
|
|
|
|
|
|
|
|
|
const res = await getModel4Second({ |
|
|
|
language: language.value, |
|
|
|
recordId: recordId.value, |
|
|
|
parentId: parentId.value, |
|
|
|
stockId: stockId.value, |
|
|
|
token: 'pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q' |
|
|
|
}) |
|
|
|
if (res.code == 200) { |
|
|
|
const rawMarkdown = res.data.markdown; |
|
|
|
const adaptedMarkdown = rawMarkdown.replace(/^### /gm, ''); // 全局替换行首的### |
|
|
|
markdownContent.value = adaptedMarkdown; |
|
|
|
// markdownContent.value = res.data.markdown |
|
|
|
htmlContent.value = marked.parse(markdownContent.value); |
|
|
|
} |
|
|
|
console.log('res', res); |
|
|
|
|
|
|
|
await getServerData() |
|
|
|
|
|
|
|
|
|
|
|
} else if (result.code == 400) { |
|
|
|
markdownContent.value = result.message; |
|
|
|
htmlContent.value = marked.parse(markdownContent.value); |
|
|
|
} else { |
|
|
|
return |
|
|
|
} |
|
|
|
}else{ |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|