Browse Source

兼容新版本hbuilderx导致h5语法消息失败的bug

master
xsx 4 months ago
parent
commit
1c44e8a13c
  1. 2
      im-uniapp/common/recorder-h5.js
  2. 2
      im-uniapp/components/chat-record/chat-record.vue

2
im-uniapp/common/recorder-h5.js

@ -63,6 +63,8 @@ let upload = () => {
}, },
file: file, file: file,
name: 'file', name: 'file',
// 最新版本(4.85)的hbuilderx有bug,如果filePath为空会直接触发fail回调
filePath: 'x',
success: (res) => { success: (res) => {
let r = JSON.parse(res.data); let r = JSON.parse(res.data);
if (r.code != 200) { if (r.code != 200) {

2
im-uniapp/components/chat-record/chat-record.vue

@ -97,7 +97,7 @@ export default {
this.$emit("send", data); this.$emit("send", data);
}).catch((e) => { }).catch((e) => {
uni.showToast({ uni.showToast({
title: e, title: JSON.stringify(e),
icon: 'none' icon: 'none'
}) })
}) })

Loading…
Cancel
Save