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