增加医慧功能1.1
This commit is contained in:
parent
e7509b3943
commit
77a5fd1057
|
@ -4,7 +4,10 @@
|
||||||
<option name="autoReloadType" value="SELECTIVE" />
|
<option name="autoReloadType" value="SELECTIVE" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="89b6391e-b093-4f28-95c9-b45ddeb7aae0" name="更改" comment="基础框架" />
|
<list default="true" id="89b6391e-b093-4f28-95c9-b45ddeb7aae0" name="更改" comment="基础框架">
|
||||||
|
<change beforePath="$PROJECT_DIR$/medical-frontend/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/medical-frontend/package-lock.json" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/medical-frontend/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/medical-frontend/package.json" afterDir="false" />
|
||||||
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
|
@ -35,26 +38,26 @@
|
||||||
<option name="hideEmptyMiddlePackages" value="true" />
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
<option name="showLibraryContents" value="true" />
|
<option name="showLibraryContents" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PropertiesComponent"><![CDATA[{
|
<component name="PropertiesComponent">{
|
||||||
"keyToString": {
|
"keyToString": {
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"com.codeium.enabled": "true",
|
"com.codeium.enabled": "true",
|
||||||
"git-widget-placeholder": "Vue",
|
"git-widget-placeholder": "Vue",
|
||||||
"ignore.virus.scanning.warn.message": "true",
|
"ignore.virus.scanning.warn.message": "true",
|
||||||
"kotlin-language-version-configured": "true",
|
"kotlin-language-version-configured": "true",
|
||||||
"last_opened_file_path": "D:/mycode/Spingboot/HealthSystem/medical-frontend",
|
"last_opened_file_path": "D:/mycode/Spingboot/HealthSystem/medical-frontend",
|
||||||
"node.js.detected.package.eslint": "true",
|
"node.js.detected.package.eslint": "true",
|
||||||
"node.js.detected.package.tslint": "true",
|
"node.js.detected.package.tslint": "true",
|
||||||
"node.js.selected.package.eslint": "(autodetect)",
|
"node.js.selected.package.eslint": "(autodetect)",
|
||||||
"node.js.selected.package.tslint": "(autodetect)",
|
"node.js.selected.package.tslint": "(autodetect)",
|
||||||
"nodejs_package_manager_path": "npm",
|
"nodejs_package_manager_path": "npm",
|
||||||
"project.structure.last.edited": "项目",
|
"project.structure.last.edited": "项目",
|
||||||
"project.structure.proportion": "0.0",
|
"project.structure.proportion": "0.0",
|
||||||
"project.structure.side.proportion": "0.2",
|
"project.structure.side.proportion": "0.2",
|
||||||
"settings.editor.selected.configurable": "vcs.Git",
|
"settings.editor.selected.configurable": "vcs.Git",
|
||||||
"vue.rearranger.settings.migration": "true"
|
"vue.rearranger.settings.migration": "true"
|
||||||
}
|
}
|
||||||
}]]></component>
|
}</component>
|
||||||
<component name="SharedIndexes">
|
<component name="SharedIndexes">
|
||||||
<attachedChunks>
|
<attachedChunks>
|
||||||
<set>
|
<set>
|
||||||
|
@ -80,6 +83,7 @@
|
||||||
<workItem from="1733666330234" duration="91000" />
|
<workItem from="1733666330234" duration="91000" />
|
||||||
<workItem from="1733666426312" duration="17000" />
|
<workItem from="1733666426312" duration="17000" />
|
||||||
<workItem from="1733666445148" duration="81000" />
|
<workItem from="1733666445148" duration="81000" />
|
||||||
|
<workItem from="1733802734282" duration="13000" />
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00001" summary="基础框架">
|
<task id="LOCAL-00001" summary="基础框架">
|
||||||
<option name="closed" value="true" />
|
<option name="closed" value="true" />
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
"name": "medical-frontend",
|
"name": "medical-frontend",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.7.9",
|
||||||
"echarts": "^5.4.3",
|
"echarts": "^5.4.3",
|
||||||
"element-plus": "^2.3.9",
|
"element-plus": "^2.3.9",
|
||||||
"pinia": "^2.1.6",
|
"pinia": "^2.1.6",
|
||||||
|
@ -987,9 +987,10 @@
|
||||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
||||||
},
|
},
|
||||||
"node_modules/axios": {
|
"node_modules/axios": {
|
||||||
"version": "1.7.8",
|
"version": "1.7.9",
|
||||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.8.tgz",
|
"resolved": "https://registry.npmmirror.com/axios/-/axios-1.7.9.tgz",
|
||||||
"integrity": "sha512-Uu0wb7KNqK2t5K+YQyVCLM76prD5sRFjKHbJYCP1J7JFGEQ6nN7HWn9+04LAeiJ3ji54lgS/gZCH1oxyrf1SPw==",
|
"integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==",
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"follow-redirects": "^1.15.6",
|
"follow-redirects": "^1.15.6",
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
|
|
|
@ -9,18 +9,18 @@
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"vue": "^3.3.4",
|
"axios": "^1.7.9",
|
||||||
"vue-router": "^4.2.4",
|
|
||||||
"element-plus": "^2.3.9",
|
|
||||||
"axios": "^1.4.0",
|
|
||||||
"pinia": "^2.1.6",
|
|
||||||
"echarts": "^5.4.3",
|
"echarts": "^5.4.3",
|
||||||
"tesseract.js": "^4.1.1"
|
"element-plus": "^2.3.9",
|
||||||
|
"pinia": "^2.1.6",
|
||||||
|
"tesseract.js": "^4.1.1",
|
||||||
|
"vue": "^3.3.4",
|
||||||
|
"vue-router": "^4.2.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vitejs/plugin-vue": "^4.2.3",
|
|
||||||
"vite": "^4.4.9",
|
|
||||||
"@element-plus/icons-vue": "^2.1.0",
|
"@element-plus/icons-vue": "^2.1.0",
|
||||||
"sass": "^1.65.1"
|
"@vitejs/plugin-vue": "^4.2.3",
|
||||||
|
"sass": "^1.65.1",
|
||||||
|
"vite": "^4.4.9"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,14 @@ const messages = ref([]);
|
||||||
|
|
||||||
const callBackend = async (message) => {
|
const callBackend = async (message) => {
|
||||||
try {
|
try {
|
||||||
const response = await axios.post('http://10.138.4.249:8080/ai/main', {
|
const response = await axios.post('http://10.10.10.44:11434/api/generate', {
|
||||||
message: message
|
"model":"llama3.3:latest",
|
||||||
|
"prompt": message,
|
||||||
|
"stream": false
|
||||||
|
}, {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json; charset=utf-8'
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return response.data;
|
return response.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -59,19 +65,13 @@ const sendMessage = async () => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
messages.value.push({ sender: 'user', content: inputMessage.value });
|
messages.value.push({ sender: 'user', content: inputMessage.value });
|
||||||
|
let putmessage=inputMessage.value;
|
||||||
inputMessage.value = '';
|
inputMessage.value = '';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await callBackend(inputMessage.value);
|
const response = await callBackend(putmessage);
|
||||||
console.log('响应内容:', response); // 打印响应内容
|
|
||||||
|
|
||||||
// 确保后端返回了正确的数据结构
|
messages.value.push({ sender: 'ai', content: response.response });
|
||||||
if (response.status === 'success' && response.data) {
|
|
||||||
messages.value.push({ sender: 'ai', content: response.data.generation });
|
|
||||||
} else {
|
|
||||||
// 如果后端返回的不是成功状态或者缺少数据,可以添加错误处理
|
|
||||||
messages.value.push({ sender: 'ai', content: '发生错误,请重试' });
|
|
||||||
}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// 捕获网络错误或其他异常
|
// 捕获网络错误或其他异常
|
||||||
console.error('请求失败:', error); // 打印错误信息
|
console.error('请求失败:', error); // 打印错误信息
|
||||||
|
|
Loading…
Reference in New Issue