Merge branch 'fix/im-0526' into msb_test

feature/ad-0531-ch
ch 2 years ago
commit 21987554f8

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

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-05-04 17:48:12
* @LastEditors: ch
* @LastEditTime: 2022-05-27 10:30:25
* @LastEditTime: 2022-05-27 11:09:52
* @Description: file content
-->
@ -13,7 +13,7 @@
<section class="section">
<div
class="section__item flex"
:class="item.payload.customType === 'orderAutoDelivery' && 'section__pointer'"
:class="item.payload.customType !== 'orderAutoDelivery' && 'section__pointer'"
v-for="item in msgData"
:key="item.id"
@click="handleDetail(item)"
@ -49,7 +49,7 @@
</template>
<script>
import UiEmpty from "@/components/UiEmpty.vue";
import {FormatDate} from '@/plugins/utils'
import {FormatDate, CreatUuid} from '@/plugins/utils'
export default {
components: { UiEmpty },
data() {
@ -66,9 +66,27 @@ export default {
},
},
mounted() {
console.log(`socketMsgData`, this.$store.state);
// console.log(`socketMsgData`, this.$store.state);
setTimeout(()=>{
this.readMsg();
},5000)
},
methods: {
/**
* 把当前会话消息置为已读
*/
readMsg(){
this.Socket.send(JSON.stringify({
traceId : CreatUuid(),
traceType : "6",
content: {
sessionId : this.msgData[0].sessionId
}
}));
this.$store.commit("setUnreadCount", 0);
},
/**
* 点击详情跳转

@ -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 { TOKEN_KEY } from "@/constants";
import ENV from '@/plugins/config/env';
function guid() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
@ -10,10 +18,9 @@ function guid() {
}
Vue.prototype.$startWebSockets = function () {
console.log();
let token = this.$cookies.get(TOKEN_KEY);
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.onopen = () => {
let traceId = guid();

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-05-04 21:57:26
* @LastEditors: ch
* @LastEditTime: 2022-05-04 22:24:07
* @LastEditTime: 2022-05-27 11:07:04
* @Description: file content
*/
@ -11,7 +11,7 @@ import {
toAsyncAwait as ToAsyncAwait,
isPhone as IsPhone,
formatDate as FormatDate,
createUUID as CreateUUID,
creatUuid as CreatUuid,
toSearchJson as ToSearchJson
} from "js-util-all"
@ -45,7 +45,7 @@ export {
// 时间格式化
FormatDate,
// 创建UUID
CreateUUID,
CreatUuid,
// 请求Search参数转化为JSON格式
ToSearchJson,
// 防抖函数

Loading…
Cancel
Save