提交 1d93209b 作者: Hao

add

父级 0da2ba73
NODE_ENV=development
VITE_USER_APP_API_URL=192.168.31.120
\ No newline at end of file
VITE_USER_APP_API_URL=http://im.wei-it.com/api
VITE_USER_APP_WS_API_URL=ws://im.wei-it.com/ws/
\ No newline at end of file
NODE_ENV=production
VITE_USER_APP_API_URL=192.168.31.112
\ No newline at end of file
VITE_USER_APP_API_URL=http://im.wei-it.com/api
VITE_USER_APP_WS_API_URL=ws://im.wei-it.com/ws/
\ No newline at end of file
......@@ -2,7 +2,7 @@
import { useUserStore } from '../store/modules/user'
import axios from "axios";
const instance = axios.create({
baseURL: `http://${import.meta.env.VITE_USER_APP_API_URL}:8080`, // 设置基础 URL
baseURL: `${import.meta.env.VITE_USER_APP_API_URL}`, // 设置基础 URL
timeout: 1000, // 设置请求超时时间
});
instance.interceptors.request.use(
......
......@@ -10,7 +10,7 @@
/>
<img
src="../assets/icon_image_s1_01.png"
@click="upfile"
@click="upImgfile"
class="icon emoji"
alt=""
/>
......@@ -21,7 +21,7 @@
alt=""
/>
</div>
<div class="chat-bar-right">
<!-- <div class="chat-bar-right">
<img
src="../assets/icon_folder_s1_01.png"
@click="upfile"
......@@ -29,7 +29,7 @@
alt=""
/>
快捷回复
</div>
</div> -->
</div>
<div
class="el-autocomplete textarea"
......@@ -56,14 +56,13 @@
type="file"
@change="fileImgChange"
/>
<!-- accept="image/*" -->
<!-- <input
ref="file"
<input
ref="imgFile"
style="display: none;"
type="file"
accept="image/*"
type="file"
@change="fileImgChange"
/> -->
/>
</div>
</template>
......@@ -75,6 +74,7 @@ import { upLoadFilesHander } from '../minxins/UploadMixin'
const inputVal = ref('')
const elAutocomplete = ref<any>(null)
const file = ref<any>(null)
const imgFile = ref<any>(null)
const imgShowWidth = ref<number>(50)
const imgShowHeight = ref<number>(50)
const showEmotion = ref<boolean>(false)
......@@ -87,6 +87,10 @@ const handleEmotion = (i: any) => {
const upfile = () => {
file.value.click()
}
const upImgfile = () => {
imgFile.value.click()
}
//上传的数据
const fileImgChange = async () => {
var e: any = window.event || event
......
......@@ -64,7 +64,7 @@ function websocketOpen() {
// 数据接收
function websocketonmessage(e: MessageEvent<any>) {
const res = JSON.parse(e.data); // 解析JSON格式的数据
console.log(res, "res");
console.log(res, "打印数据接受");
if (res.command == 11) {
//将数据放在store中
// 下面的判断则是后台返回的接收到的数据 如何处理自己决定
......
......@@ -419,9 +419,7 @@ const defaultStyle: {
}
let queryParams = ref({})
const connectMsg = () => {
const toUrl = `ws://${
import.meta.env.VITE_USER_APP_API_URL
}:8081?type=kf&code=${getUseUserStore.userInfo?.username}`
const toUrl = `${import.meta.env.VITE_USER_APP_WS_API_URL}?type=kf&code=${getUseUserStore.userInfo?.username}`
getUseUserStore.connect()
initWebSocket(toUrl)
getUserList()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论