From c5fb0ec18ad5afe90147c2c8d065eb6e948b1bb6 Mon Sep 17 00:00:00 2001 From: dashan Date: Fri, 10 Feb 2023 00:49:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=E8=A7=A3=E5=86=B3=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=88=96=E5=85=B3=E9=97=AD=E6=97=B6=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E7=AB=AF=E6=B5=8F=E8=A7=88=E5=99=A8=E4=B8=8D=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E4=BF=9D=E5=AD=98=E8=81=8A=E5=A4=A9=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/MainLayout.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index b9cd963..24ede73 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -86,7 +86,7 @@ export default { this.messages=JSON.parse(records) localStorage.removeItem(bot_message_records) } - window.addEventListener("beforeunload",()=>{ + window.addEventListener("pagehide",()=>{ localStorage.setItem(bot_message_records,JSON.stringify(this.messages)) }) }, From 658b1a48d7fc05d4823aa29878c7a1d6b6cd7ab7 Mon Sep 17 00:00:00 2001 From: dashan Date: Sun, 12 Feb 2023 22:31:41 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=E5=AE=9E=E7=8E=B0=E5=AF=B9markdown?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 22 ++--- package-lock.json | 10 +++ package.json | 2 + quasar.conf.js | 2 +- src/api/chatbot/chatbot.js | 7 +- src/components/EssentialLink.vue | 49 ----------- src/layouts/MainLayout.vue | 145 ++++++++++++++++++++++--------- src/pages/Index.vue | 61 +++++++++++-- src/utils/request.js | 2 +- 9 files changed, 186 insertions(+), 114 deletions(-) delete mode 100644 src/components/EssentialLink.vue diff --git a/README.md b/README.md index 1e720c2..71d5cca 100644 --- a/README.md +++ b/README.md @@ -2,27 +2,27 @@ chatbot web -## Install the dependencies +## 效果展示 +### PC端效果展示 +![](https://raw.githubusercontent.com/DaiShuaishuai/pic/main/picgo/pc1.jpg) +![](https://raw.githubusercontent.com/DaiShuaishuai/pic/main/picgo/pc2.jpg) +### 移动端效果展示 +![](https://raw.githubusercontent.com/DaiShuaishuai/pic/main/picgo/yd1.jpg) +![](https://raw.githubusercontent.com/DaiShuaishuai/pic/main/picgo/yd2.jpg) + +## 下载依赖 ```bash yarn # or npm install ``` -### Start the app in development mode (hot-code reloading, error reporting, etc.) +### 启动项目 ```bash quasar dev ``` - -### Lint the files -```bash -yarn lint -# or -npm run lint -``` - -### Build the app for production +### 打包 ```bash quasar build ``` diff --git a/package-lock.json b/package-lock.json index 1af24d3..d3b22bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6186,6 +6186,11 @@ "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==", "dev": true }, + "github-markdown-css": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/github-markdown-css/-/github-markdown-css-5.2.0.tgz", + "integrity": "sha512-hq5RaCInSUZ48bImOZpkppW2/MT44StRgsbsZ8YA4vJFwLKB/Vo3k7R2t+pUGqO+ThG0QDMi96TewV/B3vyItg==" + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -7825,6 +7830,11 @@ "object-visit": "^1.0.0" } }, + "marked": { + "version": "4.2.12", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.12.tgz", + "integrity": "sha512-yr8hSKa3Fv4D3jdZmtMMPghgVt6TWbk86WQaWhDloQjRSQhMMYCAro7jP7VDJrjjdV8pxVxMssXS8B8Y5DZ5aw==" + }, "matcher": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", diff --git a/package.json b/package.json index ac74acf..a79b51f 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,8 @@ "dependencies": { "@quasar/extras": "^1.0.0", "core-js": "^3.6.5", + "github-markdown-css": "^5.2.0", + "marked": "^4.2.12", "moment": "^2.29.4", "quasar": "^1.0.0" }, diff --git a/quasar.conf.js b/quasar.conf.js index 9f00b62..7d53a89 100644 --- a/quasar.conf.js +++ b/quasar.conf.js @@ -81,7 +81,7 @@ module.exports = function (/* ctx */) { proxy: { // 接口地址代理 '/': { - target: 'http://localhost:8090', // 接口的域名 + target: 'http://localhost:8092', // 接口的域名 secure: false, // 如果是https接口,需要配置这个参数 changeOrigin: true // 如果接口跨域,需要进行这个参数配置 } diff --git a/src/api/chatbot/chatbot.js b/src/api/chatbot/chatbot.js index 72fd2a8..aa7bfaf 100644 --- a/src/api/chatbot/chatbot.js +++ b/src/api/chatbot/chatbot.js @@ -1,7 +1,8 @@ import service from "../../utils/request"; -export const sendQuestion= (param)=>{ +export const sendQuestion= (params)=>{ return service({//获取新闻列表 - url:'/bot?question='+param, - method:'get' + url:'/bot', + method:'get', + params }) } \ No newline at end of file diff --git a/src/components/EssentialLink.vue b/src/components/EssentialLink.vue deleted file mode 100644 index 62582d1..0000000 --- a/src/components/EssentialLink.vue +++ /dev/null @@ -1,49 +0,0 @@ - - - diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index 24ede73..f652510 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -15,14 +15,37 @@ + 机器人型号 + + - - 发送问题给机器人 - + + 发送问题给机器人 + - - 清空聊天记录 - + + 清空聊天记录 + @@ -62,70 +93,100 @@