修改消息已读

fix/im-0526
ch 2 years ago
parent 697b08c666
commit 2a63673248

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-05-05 14:40:00 * @Date: 2022-05-05 14:40:00
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-07 10:51:53 * @LastEditTime: 2022-05-27 10:47:18
* @Description: 根据git分支生成对应环境的环境变量 * @Description: 根据git分支生成对应环境的环境变量
* 开发时如果环境变量换了可以不用重启服务直接运行node env.config.js即可 * 开发时如果环境变量换了可以不用重启服务直接运行node env.config.js即可
*/ */
@ -12,16 +12,20 @@ const getRepoInfo = require('git-repo-info');
const envConfig = { const envConfig = {
dev : { dev : {
base_url: 'https://k8s-horse-gateway.mashibing.cn' base_url: 'https://k8s-horse-gateway.mashibing.cn',
imUrl : 'wss://k8s-horse-gateway.mashibing.cn'
}, },
test : { test : {
base_url: 'https://k8s-horse-gateway.mashibing.cn' base_url: 'https://k8s-horse-gateway.mashibing.cn',
imUrl : 'wss://k8s-horse-gateway.mashibing.cn'
}, },
beta : { beta : {
base_url: 'https://you-gateway.mashibing.com' base_url: 'https://you-gateway.mashibing.com',
imUrl : 'wss://you-gateway.mashibing.cn'
}, },
prod : { prod : {
base_url: 'https://you-gateway.mashibing.com' base_url: 'https://you-gateway.mashibing.com',
imUrl : 'wss://you-gateway.mashibing.cn'
} }
} }
const branch = getRepoInfo().branch; // 调用获取git信息 const branch = getRepoInfo().branch; // 调用获取git信息

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-05-04 17:48:12 * @Date: 2022-05-04 17:48:12
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-05-27 10:30:25 * @LastEditTime: 2022-05-27 10:56:40
* @Description: file content * @Description: file content
--> -->
@ -13,7 +13,7 @@
<section class="section"> <section class="section">
<div <div
class="section__item flex" class="section__item flex"
:class="item.payload.customType === 'orderAutoDelivery' && 'section__pointer'" :class="item.payload.customType !== 'orderAutoDelivery' && 'section__pointer'"
v-for="item in msgData" v-for="item in msgData"
:key="item.id" :key="item.id"
@click="handleDetail(item)" @click="handleDetail(item)"
@ -66,9 +66,23 @@ export default {
}, },
}, },
mounted() { mounted() {
console.log(`socketMsgData`, this.$store.state); // console.log(`socketMsgData`, this.$store.state);
setTimeout(()=>{
this.readMsg()
},2000)
}, },
methods: { methods: {
/**
* 把当前会话消息置为已读
*/
async readMsg(){
this.Socket.setRead({
content: {
sessionId : this.msgData[0].sessionId
}
});
},
/** /**
* 点击详情跳转 * 点击详情跳转

@ -1,5 +1,13 @@
/*
* @Author: ch
* @Date: 2022-05-20 09:59:06
* @LastEditors: ch
* @LastEditTime: 2022-05-27 10:51:44
* @Description: file content
*/
import Vue from "vue"; import Vue from "vue";
import { TOKEN_KEY } from "@/constants"; import { TOKEN_KEY } from "@/constants";
import ENV from '@/plugins/config/env';
function guid() { function guid() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
@ -10,10 +18,9 @@ function guid() {
} }
Vue.prototype.$startWebSockets = function () { Vue.prototype.$startWebSockets = function () {
console.log();
let token = this.$cookies.get(TOKEN_KEY); let token = this.$cookies.get(TOKEN_KEY);
if (token && !Vue.prototype.Socket) { if (token && !Vue.prototype.Socket) {
let url = `wss://k8s-horse-gateway.mashibing.cn/ws?client=${token}&type=1`; let url = `${ENV.imUrl}/ws?client=${token}&type=1`;
Vue.prototype.Socket = new WebSocket(url); Vue.prototype.Socket = new WebSocket(url);
Vue.prototype.Socket.onopen = () => { Vue.prototype.Socket.onopen = () => {
let traceId = guid(); let traceId = guid();

Loading…
Cancel
Save