提交 1d93209b 作者: Hao

add

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