From a1e8fc1ef04e8dc8302a052bbd21636248fa822c Mon Sep 17 00:00:00 2001 From: "1960116313@qq.com" <1960116313@qq.com> Date: Fri, 26 Jan 2024 00:26:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9Edocker=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=20fix:=E4=BF=AE=E6=94=B9=E9=82=80=E8=AF=B7=E5=A5=BD=E5=8F=8B?= =?UTF-8?q?=20feat:=E6=96=B0=E5=A2=9E=E7=BA=BF=E4=B8=8A=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.production | 6 +-- Dockerfile | 11 ++++++ nginx/default.conf | 38 +++++++++++++++++++ src/api/base/message.ts | 6 +-- src/api/base/repository.ts | 2 +- src/utils/axios/index.ts | 6 +-- .../task/components/InviteForm/index.vue | 6 +-- 7 files changed, 62 insertions(+), 13 deletions(-) create mode 100644 Dockerfile create mode 100644 nginx/default.conf diff --git a/.env.production b/.env.production index 76b6fc2..40563ef 100644 --- a/.env.production +++ b/.env.production @@ -1,11 +1,11 @@ # 正式环境 # 公共地址 -VITE_GLOB_BASE_URL = "http://192.168.1.134:9872" +VITE_GLOB_BASE_URL = "http://223.99.228.207:19872" # 本地MQTT地址 -VITE_GLOB_MQTT_HOST = "192.168.1.231" -VITE_GLOB_MQTT_PORT = 8083 +VITE_GLOB_MQTT_HOST = "223.99.228.240" +VITE_GLOB_MQTT_PORT = 28083 VITE_GLOB_MQTT_PROTOCOL = "ws" # 本地MQTT用户名 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9f297b4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +#拉取nginx +FROM nginx:latest + +#将dist文件中的内容复制到‘/usr/share/nginx/html/`这个目录下面 +COPY dist/ /usr/share/nginx/html/ + +#用本地配置文件来替换ngin×镜像里的默认配置 +COPY nginx/default.conf /etc/nginx/nginx.conf + +#对外暴露接口 +EXPOSE 80 \ No newline at end of file diff --git a/nginx/default.conf b/nginx/default.conf new file mode 100644 index 0000000..eca9336 --- /dev/null +++ b/nginx/default.conf @@ -0,0 +1,38 @@ +worker_processes 1; +#工作模式以及连接数上限 +events { + #accept_mutex on; #设置网路连接序列化,防止惊群现象发生,默认为on + #multi_accept on; #设置一个进程是否同时接受多个网络连接,默认为off + #use epoll; #事件驱动模型,select|poll|kqueue|epoll|resig|/dev/poll|eventport + worker_connections 1024;#最大连接数,默认为512 +} + +http { + + include mime.types; + + default_type application/octet-stream; + + sendfile on; + + keepalive_timeout 65; + + server { + + listen 80; + + server_name localhost; + + location / { + + root /usr/share/nginx/html; + + index index.html index.htm; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root html; + } + } +} diff --git a/src/api/base/message.ts b/src/api/base/message.ts index 705d3d5..1b8c165 100644 --- a/src/api/base/message.ts +++ b/src/api/base/message.ts @@ -103,7 +103,7 @@ export async function sendTextToImage(data: { question: string }) { return defHttp.post({ - url: `/open-gpts/gpts/getDallEImages`, + url: `/open-chat/gpts/getDallEImages`, data, timeout: 120 * 1000, }) @@ -117,7 +117,7 @@ export async function sendRepository(data: { question: string }) { return defHttp.post({ - url: `/open-gpts/gpts/getQanythingStreamChat`, + url: `/open-chat/gpts/getQanythingStreamChat`, data, timeout: 120 * 1000, }) @@ -132,7 +132,7 @@ export async function sendVisualAnalysis(data: { fileUrl: string }) { return defHttp.post({ - url: `/open-gpts/gpts/getImageVision`, + url: `/open-chat/gpts/getImageVision`, data, timeout: 120 * 1000, }) diff --git a/src/api/base/repository.ts b/src/api/base/repository.ts index ce15cfe..e73c2aa 100644 --- a/src/api/base/repository.ts +++ b/src/api/base/repository.ts @@ -5,6 +5,6 @@ import { defHttp } from '@/utils/axios/index' */ export async function repositoryFileList(id: string) { return defHttp.get({ - url: `/open-gpts/qanything/getFileList?kbId=${id}`, + url: `/open-chat/qanything/getFileList?kbId=${id}`, }) } diff --git a/src/utils/axios/index.ts b/src/utils/axios/index.ts index 99e93a4..b7ba283 100644 --- a/src/utils/axios/index.ts +++ b/src/utils/axios/index.ts @@ -25,11 +25,11 @@ const whiteList: string[] = ['/login', '/refresh-token'] const notDecryptWhiteList = [ '/hulk-auth/oauth/token', '/open-chat/chat/session', - '/open-gpts/gpts/getDallEImages', + '/open-chat/gpts/getDallEImages', '/open-chat/chat/stopGenerate', '/hulk-system/hulk-resource/oss/endpoint/put-file', - '/open-gpts/gpts/getQanythingStreamChat', - '/open-gpts/gpts/getImageVision', + '/open-chat/gpts/getQanythingStreamChat', + '/open-chat/gpts/getImageVision', ] /** diff --git a/src/views/task/components/InviteForm/index.vue b/src/views/task/components/InviteForm/index.vue index f679d76..32d0d2f 100644 --- a/src/views/task/components/InviteForm/index.vue +++ b/src/views/task/components/InviteForm/index.vue @@ -47,7 +47,7 @@ const code = userStore.getChatInfo?.inviteCode as string
- +