From 3d46cef3bd86b5dec3fc72623cdc5eff65088c34 Mon Sep 17 00:00:00 2001 From: BBIT-Kai <2911862937@qq.com> Date: Wed, 5 Nov 2025 18:08:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/router/routes/modules/aibot.ts | 56 ++++ .../web-antd/src/router/routes/modules/cv.ts | 2 +- .../web-antd/src/views/aibot/test/index.vue | 313 ++++++++++++++++++ vue/scripts/deploy/Dockerfile_aibottest | 14 + vue/scripts/deploy/nginx_aibottest.conf | 37 +++ 5 files changed, 421 insertions(+), 1 deletion(-) create mode 100644 vue/apps/web-antd/src/router/routes/modules/aibot.ts create mode 100644 vue/apps/web-antd/src/views/aibot/test/index.vue create mode 100644 vue/scripts/deploy/Dockerfile_aibottest create mode 100644 vue/scripts/deploy/nginx_aibottest.conf diff --git a/vue/apps/web-antd/src/router/routes/modules/aibot.ts b/vue/apps/web-antd/src/router/routes/modules/aibot.ts new file mode 100644 index 0000000..8190d92 --- /dev/null +++ b/vue/apps/web-antd/src/router/routes/modules/aibot.ts @@ -0,0 +1,56 @@ +import type { RouteRecordRaw } from 'vue-router'; + +import { IFrameView } from '#/layouts'; +import { $t } from '#/locales'; + +const baseAddress = '10.0.4.22'; + +const routes: RouteRecordRaw[] = [ + { + meta: { + icon: 'mdi:robot', + authority: ['aibot'], + keepAlive: false, + order: 2, + title: $t('智能机器人'), + }, + name: 'AiBot', + path: '/aibot', + children: [ + { + name: 'Bot-test', + path: '/set/ai-bot-test', + component: IFrameView, + meta: { + icon: 'mdi:robot-dead', + title: $t('测试页'), + link: `http://${baseAddress}:8092/`, + }, + }, + { + name: 'Bot-test', + path: '/set/ai-bot-test', + component: IFrameView, + meta: { + icon: 'mdi:robot-excited', + title: $t('后台'), + link: `http://${baseAddress}:8005/`, + }, + }, + { + name: 'CSC-knowledge', + path: '/aibot/aibot-knowledge', + meta: { + authority: ['service-knowledge'], + icon: 'mdi:robot-confused', + title: $t('知识库'), + keepAlive: true, + }, + component: () => + import('#/views/llm/service/service-knowledge/index.vue'), + }, + ], + }, +]; + +export default routes; diff --git a/vue/apps/web-antd/src/router/routes/modules/cv.ts b/vue/apps/web-antd/src/router/routes/modules/cv.ts index 16e4116..3fa584c 100644 --- a/vue/apps/web-antd/src/router/routes/modules/cv.ts +++ b/vue/apps/web-antd/src/router/routes/modules/cv.ts @@ -76,7 +76,7 @@ const routes: RouteRecordRaw[] = [ component: IFrameView, meta: { icon: 'mdi:abjad-arabic', - link: 'http://171.212.101.199:13013/', + link: 'https://ai.ronsunny.cn:8094/', keepAlive: true, title: '标注平台入口', }, diff --git a/vue/apps/web-antd/src/views/aibot/test/index.vue b/vue/apps/web-antd/src/views/aibot/test/index.vue new file mode 100644 index 0000000..5974a7d --- /dev/null +++ b/vue/apps/web-antd/src/views/aibot/test/index.vue @@ -0,0 +1,313 @@ + + + + + + + + + + + + 新聊天 + + + + + + {{ item.title }} + + + + + + + {{ conv.title }} + {{ conv.updatedAt }} + + + + + + + + + + + + + + {{ selectedAI?.welcome_words }} + + + + + + + + + + + + + + + + + + + + 发送 + + + + + + + diff --git a/vue/scripts/deploy/Dockerfile_aibottest b/vue/scripts/deploy/Dockerfile_aibottest new file mode 100644 index 0000000..0c8f380 --- /dev/null +++ b/vue/scripts/deploy/Dockerfile_aibottest @@ -0,0 +1,14 @@ +FROM nginx:1.27.4-alpine + +# 配置 nginx +RUN echo "types { application/javascript js mjs; }" > /etc/nginx/conf.d/mjs.conf \ + && rm -rf /etc/nginx/conf.d/default.conf + +# 只拷贝打包好的 dist +COPY apps/bot_web_test /usr/share/nginx/html +# 拷贝 nginx 配置 +COPY scripts/deploy/nginx_aibottest.conf /etc/nginx/nginx.conf + +#EXPOSE 8092 因为使用kong做网关 可以直接使用ce-vue:8091访问 所以这里可以不暴露给内网 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/vue/scripts/deploy/nginx_aibottest.conf b/vue/scripts/deploy/nginx_aibottest.conf new file mode 100644 index 0000000..2ad9393 --- /dev/null +++ b/vue/scripts/deploy/nginx_aibottest.conf @@ -0,0 +1,37 @@ +worker_processes 1; + +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + sendfile on; + server { + listen 8092; + server_name localhost; + + location / { + root /usr/share/nginx/html; + try_files $uri $uri/ /test_page.html; + index test_page.html; + # Enable CORS + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; + add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; + if ($request_method = 'OPTIONS') { + add_header 'Access-Control-Max-Age' 1728000; + add_header 'Content-Type' 'text/plain charset=UTF-8'; + add_header 'Content-Length' 0; + return 204; + } + } + + error_page 500 502 503 504 /50x.html; + + location = /50x.html { + root /usr/share/nginx/html; + } + } +}