{"success":false,"error":{"code":"FunctionBizError","message":"Cannot read property 'slice' of undefined","httpStatus":200}}
原因是微信小程序,用微信登录后未设置昵称,导致后端判断不了,增加一个判断即可
云对象 uni-im-co/index.obj.js
443行
let title = (nickname || username || email || mobile).slice(0, 20)
修改为
let title = (nickname || username || email || mobile)
if(title!=undefined){
title = title.slice(0, 20)
}
456行
title: title.slice(0, 20), // "收到im消息,离线时显示的标题",
修改为
title: title, // "收到im消息,离线时显示的标题"
1 个评论
要回复文章请先登录或注册
Lvzz