Browse Source

feat:新增docker配置

fix:修改邀请好友
feat:新增线上环境
dxj
杜贤金 1 year ago
parent
commit
a1e8fc1ef0
  1. 6
      .env.production
  2. 11
      Dockerfile
  3. 38
      nginx/default.conf
  4. 6
      src/api/base/message.ts
  5. 2
      src/api/base/repository.ts
  6. 6
      src/utils/axios/index.ts
  7. 6
      src/views/task/components/InviteForm/index.vue

6
.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地址 # 本地MQTT地址
VITE_GLOB_MQTT_HOST = "192.168.1.231" VITE_GLOB_MQTT_HOST = "223.99.228.240"
VITE_GLOB_MQTT_PORT = 8083 VITE_GLOB_MQTT_PORT = 28083
VITE_GLOB_MQTT_PROTOCOL = "ws" VITE_GLOB_MQTT_PROTOCOL = "ws"
# 本地MQTT用户名 # 本地MQTT用户名

11
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

38
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;
}
}
}

6
src/api/base/message.ts

@ -103,7 +103,7 @@ export async function sendTextToImage(data: {
question: string question: string
}) { }) {
return defHttp.post({ return defHttp.post({
url: `/open-gpts/gpts/getDallEImages`, url: `/open-chat/gpts/getDallEImages`,
data, data,
timeout: 120 * 1000, timeout: 120 * 1000,
}) })
@ -117,7 +117,7 @@ export async function sendRepository(data: {
question: string question: string
}) { }) {
return defHttp.post({ return defHttp.post({
url: `/open-gpts/gpts/getQanythingStreamChat`, url: `/open-chat/gpts/getQanythingStreamChat`,
data, data,
timeout: 120 * 1000, timeout: 120 * 1000,
}) })
@ -132,7 +132,7 @@ export async function sendVisualAnalysis(data: {
fileUrl: string fileUrl: string
}) { }) {
return defHttp.post({ return defHttp.post({
url: `/open-gpts/gpts/getImageVision`, url: `/open-chat/gpts/getImageVision`,
data, data,
timeout: 120 * 1000, timeout: 120 * 1000,
}) })

2
src/api/base/repository.ts

@ -5,6 +5,6 @@ import { defHttp } from '@/utils/axios/index'
*/ */
export async function repositoryFileList(id: string) { export async function repositoryFileList(id: string) {
return defHttp.get({ return defHttp.get({
url: `/open-gpts/qanything/getFileList?kbId=${id}`, url: `/open-chat/qanything/getFileList?kbId=${id}`,
}) })
} }

6
src/utils/axios/index.ts

@ -25,11 +25,11 @@ const whiteList: string[] = ['/login', '/refresh-token']
const notDecryptWhiteList = [ const notDecryptWhiteList = [
'/hulk-auth/oauth/token', '/hulk-auth/oauth/token',
'/open-chat/chat/session', '/open-chat/chat/session',
'/open-gpts/gpts/getDallEImages', '/open-chat/gpts/getDallEImages',
'/open-chat/chat/stopGenerate', '/open-chat/chat/stopGenerate',
'/hulk-system/hulk-resource/oss/endpoint/put-file', '/hulk-system/hulk-resource/oss/endpoint/put-file',
'/open-gpts/gpts/getQanythingStreamChat', '/open-chat/gpts/getQanythingStreamChat',
'/open-gpts/gpts/getImageVision', '/open-chat/gpts/getImageVision',
] ]
/** /**

6
src/views/task/components/InviteForm/index.vue

@ -47,7 +47,7 @@ const code = userStore.getChatInfo?.inviteCode as string
<div class="close" @click="handleClose"> <div class="close" @click="handleClose">
</div> </div>
<div class="qr"> <div class="qr">
<QRCode ref="qrcodeCanvasRef" :size="145" :value="`http://192.168.1.121:5173/Login?inviteCode=${code}`" /> <QRCode ref="qrcodeCanvasRef" :size="145" :value="`http://223.99.228.207:6001/#/login?inviteCode=${code}`" />
</div> </div>
<Button type="primary" class="save-qr" @click="dowloadChange"> <Button type="primary" class="save-qr" @click="dowloadChange">
保存二维码 保存二维码
@ -62,8 +62,8 @@ const code = userStore.getChatInfo?.inviteCode as string
{{ code }} {{ code }}
</div> </div>
<div class="i-copy"> <div class="i-copy">
<Button class="copy-btn" @click="copyText(code)"> <Button class="copy-btn" @click="copyText(`http://223.99.228.207:6001/#/login?inviteCode=${code}`)">
复制邀请码 复制邀请码链接
</Button> </Button>
</div> </div>
</div> </div>

Loading…
Cancel
Save