diff --git a/config/index.js b/config/index.js index 96d3c85..74c1ca1 100644 --- a/config/index.js +++ b/config/index.js @@ -14,7 +14,7 @@ module.exports = { // 代理列表, 是否开启代理通过[./dev.env.js]配置 proxyTable: devEnv.OPEN_PROXY === false ? {} : { '/proxyApi': { - target: "http://47.75.182.93:8090/sqx_fast/", + target: "https://sausers.blxinchuang.com/sqx_fast/", changeOrigin: true, pathRewrite: { '^/proxyApi': '' diff --git a/src/utils/enumData.js b/src/utils/enumData.js index 778415f..1ceefa1 100644 --- a/src/utils/enumData.js +++ b/src/utils/enumData.js @@ -1,7 +1,7 @@ import Vue from 'vue' // const serverUrl = "https://admin.sjajk.com/sqx_fast/";//生产需替换 -const serverUrl = "http://47.75.182.93:8090/sqx_fast/"; +const serverUrl = "https://sausers.blxinchuang.com/sqx_fast/"; export const serverPaths = { serverUrl , diff --git a/src/utils/httpRequest.js b/src/utils/httpRequest.js index 5297249..cebb5fc 100644 --- a/src/utils/httpRequest.js +++ b/src/utils/httpRequest.js @@ -53,7 +53,7 @@ http.adornUrl = (actionName) => { http.adornWss = (actionName) => { // 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截! // return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl) + actionName - return 'wss://anmoadmin5.0.xianmaxiong.com' + actionName + return 'wss://sausers.blxinchuang.com/wss/' + actionName // return 'https://anmoadmin5.0.xianmaxiong.comsqx_fast/' + actionName } diff --git a/src/views/vueMchat/vueMchat.vue b/src/views/vueMchat/vueMchat.vue index f9f8de0..7e97ff2 100644 --- a/src/views/vueMchat/vueMchat.vue +++ b/src/views/vueMchat/vueMchat.vue @@ -17,19 +17,19 @@ v-bind:class="{ blue: index == current }" v-for="(item, index) in chatList" :key="index" @click="clickItem(item, index)">
-
+
-
+
{{ item.userName }}
{{ item.content }}
-
+
- {{ item.contentTime.substring(11, 16) }} + {{ item.messageTime.substring(11, 16) }}
@@ -58,18 +58,16 @@
- - +
-
+
{{ item.content }} @@ -78,7 +76,7 @@
{{ item.createTime }}
-
+
@@ -252,7 +250,7 @@ import { serverPaths } from '@/utils/enumData' initWebSocket() { this.websock = new WebSocket( - this.$http.adornWss("websocket/0")); + this.$http.adornWss("chatSocket/0")); // "ws://192.168.1.17:8180/sqx_fast/websocket/0"); //这个连接ws://固定,后面的根据自己的IP和端口进行改变,我设置监听的就是8081 // this.websock = new WebSocket("ws://yungameadmin.xianmxkj.com/ws/websocket/0"); this.websock.onmessage = this.websocketonmessage; @@ -360,11 +358,12 @@ import { serverPaths } from '@/utils/enumData' }, // 点击聊天列表的某一项 clickItem(item, index) { + console.log(`🚀 ~ clickItem ~ item:`, item) this.current = index; this.userId = item.userId; this.name = item.userName; - this.userHead = item.userHead; - this.chatId = item.chatId; + this.userHead = item.avatar; + this.chatId = item.chatConversationId; this.chatList[index].storeCount = 0 this.clickItem2(); this.initWebSocket(); @@ -373,16 +372,18 @@ import { serverPaths } from '@/utils/enumData' clickItem2() { this.$http({ - url: this.$http.adornUrl("chatsContent/storeList"), + url: this.$http.adornUrl("chat/selectChatContent"), method: "get", params: this.$http.adornParams({ - chatId: this.chatId, + chatConversationId: this.chatId, + page: 1, + limit: 10, }), }).then(({ data }) => { let returnData = data.data; - this.dialogueList = returnData; + this.dialogueList = returnData.list.reverse(); let ele = document.getElementById("ele"); this.$nextTick(() => { ele.scrollTop = ele.scrollHeight; @@ -393,15 +394,16 @@ import { serverPaths } from '@/utils/enumData' sendTextarea(type) { let data = { content: this.content, - type: type, + messageType: type, createTime: this.info.stockDate, sendType: this.sendType, - userId: this.userId, + userId: 0, storeId: this.storeId, - chatId: this.chatId, + chatConversationId: this.chatId, }; this.numlist = data; data = JSON.stringify(data); + console.log(`🚀 ~ sendTextarea ~ data:`, data) this.websock.send(data); this.content = ""; this.dialogueList.push(this.numlist); @@ -450,20 +452,22 @@ import { serverPaths } from '@/utils/enumData' dataSelect() { this.tableDataLoading = true; this.$http({ - url: this.$http.adornUrl("chats/list"), + url: this.$http.adornUrl("chat/selectChatConversationPage"), method: "get", params: this.$http.adornParams({ - userName: this.userName, + nickName: this.userName, storeId: this.storeId, + page: 1, + limit: 10, }), }).then(({ data }) => { this.tableDataLoading = false; let returnData = data.data; - this.chatList = returnData; + this.chatList = returnData.list; - this.clickItem(this.chatList[this.current], this.current); + // this.clickItem(this.chatList[this.current], this.current); }); }, // 验证只能上传音频 @@ -484,11 +488,12 @@ import { serverPaths } from '@/utils/enumData' }, }, mounted() { - // this.timer = window.setInterval(() => { - // setTimeout(() => { - // this.dataSelect() - // },0) - // },2000) + this.dataSelect() + this.timer = window.setInterval(() => { + setTimeout(() => { + this.dataSelect() + },0) + },4000) }, destroyed() { window.clearInterval(this.timer);