mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-08 18:23:45 +08:00
add Makefile, fixed websocket url for https
This commit is contained in:
@@ -2,7 +2,7 @@ import axios from 'axios'
|
||||
import {getSessionId} from "@/utils/storage";
|
||||
|
||||
axios.defaults.timeout = 5000
|
||||
axios.defaults.baseURL = process.env.VUE_APP_API_SECURE === true ? 'https://' + process.env.VUE_APP_API_HOST : 'http://' + process.env.VUE_APP_API_HOST
|
||||
axios.defaults.baseURL = process.env.VUE_APP_API_HOST
|
||||
axios.defaults.withCredentials = true;
|
||||
axios.defaults.headers.post['Content-Type'] = 'application/json'
|
||||
|
||||
|
||||
@@ -198,6 +198,8 @@ export default defineComponent({
|
||||
confirmButtonText: '重连会话',
|
||||
cancelButtonText: '不聊了',
|
||||
type: 'warning',
|
||||
showClose: false,
|
||||
closeOnClickModal: false
|
||||
}
|
||||
).then(() => {
|
||||
this.connect();
|
||||
@@ -214,7 +216,7 @@ export default defineComponent({
|
||||
connect: function () {
|
||||
// 初始化 WebSocket 对象
|
||||
const token = getSessionId();
|
||||
const socket = new WebSocket('ws://' + process.env.VUE_APP_API_HOST + '/api/chat?token=' + token);
|
||||
const socket = new WebSocket(process.env.VUE_APP_WS_HOST + '/api/chat?token=' + token);
|
||||
socket.addEventListener('open', () => {
|
||||
ElMessage.success('创建会话成功!');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user