问题描述
以下是我写的demo:tok是获取成功的.self是自身好友.target是要删除的好友.执行时success的.但是后台没有删掉这个好友.大神帮忙看下是为什么?function dele(self,target){$.ajax({ type: 'post', contentType: 'application/json', dataType: 'json', async: false, url: 'https://a1.easemob.com/fyl/testhx/users/'+self+'/contacts/users/'+target, headers:{"Authorization":"Bearer "+tok }, success: function (data) { alert("success:" + data); }, error: function (data) { alert("error:" + data); }});}
解决方案
调rest接口看看这个用户的好友是否还存在这个用户http://easemob.com/docs/rest/userapi/#queryfriend
解决方案二:
返回数据如下:da: Objectaction: "post"application: "12381b70-d99c-11e4-b501-838fac4e245e"applicationName: "testhx"duration: 130entities: Array0: Objectactivated: truecreated: 1428631325136modified: 1428631325136nickname: "Leefo2"type: "user"username: "Leefo2"uuid: "96008d0a-df25-11e4-b43f-af1b43fcf2ab"__proto__: Objectlength: 1__proto__: Arrayorganization: "fyl"path: "/users/714eef6a-df25-11e4-b7af-2306dbc1e12e/contacts"timestamp: 1428892712102uri: "https://a1.easemob.com/fyl/testhx/users/714eef6a-df25-11e4-b7af-2306dbc1e12e/contacts"
解决方案三:
> forum.php?mod=redirect&goto=findpost&pid=1745&ptid=833返回数据如下:da: Objectaction: "post"你这个请求的response是删除好友的吗? delete 方法解除好友关系