提交 00afd8bc 作者: 毛细亚

发送游戏成功

上级 6eb7fa02
......@@ -14,7 +14,7 @@ import moment from 'moment'
import VConsole from 'vconsole';
import uploading from '@/utils/cos-upload'
import errorHandle from '@/utils/errorHandle'
import { getParams } from '@/utils/index'
import { getParams,deepClone } from '@/utils/index'
import * as ww from '@wecom/jssdk'
import globalComponent from '@/components/register.js'
import loadmore from '@/directive/loadmore/index.js' // 加载更多
......@@ -37,6 +37,7 @@ Vue.prototype.$cookies = Cookies;
Vue.prototype.$lodash = _;
Vue.prototype.$moment = moment;
Vue.prototype.$ww = ww;
Vue.prototype.$clone = deepClone // vue原型挂载递归拷贝方法
new Vue({
router,
store,
......
......@@ -41,10 +41,12 @@ export default {
* @param {*} type 消息类型
*/
async sendChatMessage(content, type) {
// 开始发送
console.log(content,type,'content,type',this.pendingGameLog,this.isLoggingEnabled)
try {
// 调用原始的sendChatMessage方法
const result = await originalSendChatMessage(content, type)
console.log(result,'发送成功的回调')
// 如果有待记录的游戏日志,则记录
if (this.pendingGameLog && this.isLoggingEnabled) {
await this.recordGameLog(result, content, type)
......@@ -64,13 +66,15 @@ export default {
* @param {String} type 消息类型
*/
async recordGameLog(messageInfo, content, type) {
console.log(messageInfo, content, type,'进入记日志方法')
if (!this.pendingGameLog) {
return
}
try {
const chatUser = this.chatUserForLog
console.log(this.pendingGameLog,'pendingGameLog')
// 构建日志数据
const logData = {
game_id: this.pendingGameLog.game_id,
......@@ -78,7 +82,7 @@ export default {
game_type: this.pendingGameLog.game_type || '',
main_game_id: this.pendingGameLog.main_game_id || '',
weixin_blongs_id: this.pendingGameLog.weixin_blongs_id || '',
content: this.formatLogContent(messageInfo?.message || content, type),
content: [this.formatLogContent(messageInfo?.message || content, type)],
type: this.pendingGameLog.type || 2,
frontend_message_id: messageInfo?.frontend_message_id || '',
session_id: messageInfo?.session_id || '',
......@@ -96,7 +100,6 @@ export default {
} else {
console.warn('游戏日志记录失败:', response.msg)
}
// 清空待记录的日志信息
this.pendingGameLog = null
this.set_send_game_log(null)
......
......@@ -3,7 +3,7 @@
title="新建渠道链接"
:visible="show"
@close='close'
size="360px"
width="320px"
>
<div class="channelContent">
<el-form
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论