Browse Source

元数据增加路由参数

master
xueyinfei 2 weeks ago
parent
commit
d5d77516b8
  1. 8
      vue-fastapi-frontend/src/views/aichat/MdRenderer.vue
  2. 2
      vue-fastapi-frontend/src/views/aichat/aichat.vue

8
vue-fastapi-frontend/src/views/aichat/MdRenderer.vue

@ -21,7 +21,7 @@
</div> </div>
</div> </div>
<div v-if="item.type === 'router'" style="width: 100%;margin-top: 5px"> <div v-if="item.type === 'router'" style="width: 100%;margin-top: 5px">
<el-link :underline="false" @click="jumpToPath(item.content)">{{'跳转到'+ item.content.menuName}}</el-link> <el-link :underline="false" @click="jumpToPath(item.content)">{{'跳转到'+ item.content.name}}</el-link>
</div> </div>
<div v-else style="width: 100%;margin-top: 5px"> <div v-else style="width: 100%;margin-top: 5px">
<markdown :markdown-string="item.content"></markdown> <markdown :markdown-string="item.content"></markdown>
@ -56,9 +56,9 @@ function jumpToPath(content){
let obj = routes.find(route =>{return route.meta?.id === content.id;}) let obj = routes.find(route =>{return route.meta?.id === content.id;})
if (obj){ if (obj){
let path = '?' let path = '?'
let params = content.params let params = content.params || {}
for (const key of params.keys()){ for (const key of Object.keys(params)){
path += key+"="+params[key] + "&" path += key+"="+params?.[key] + "&"
} }
path = path.slice(0, -1); path = path.slice(0, -1);
path = obj.path + path path = obj.path + path

2
vue-fastapi-frontend/src/views/aichat/aichat.vue

@ -534,6 +534,8 @@ const getWrite = (reader) => {
lastMsg.content.push({ content: chunk.html_image, type: "html_image" }); lastMsg.content.push({ content: chunk.html_image, type: "html_image" });
} else if (chunk.table?.length) { } else if (chunk.table?.length) {
lastMsg.content.push({ content: chunk.table, type: "table" }); lastMsg.content.push({ content: chunk.table, type: "table" });
} else if (chunk.router?.length) {
lastMsg.content.push({ content: chunk.router, type: "router" });
} else if (chunk.choices?.length) { } else if (chunk.choices?.length) {
// 6 // 6
// const text = chunk.choices[0].delta.content.replace(/\n/g, "\n\n"); // const text = chunk.choices[0].delta.content.replace(/\n/g, "\n\n");

Loading…
Cancel
Save