备份
This commit is contained in:
@@ -63,21 +63,49 @@
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
|
||||
this.list=this.$fc.sortList({list:list,key:'name'})
|
||||
|
||||
|
||||
console.log(customHttp)
|
||||
console.log("================开始请求通讯录列表")
|
||||
|
||||
// 局部修改配置,局部配置优先级高于全局配置
|
||||
customHttp.customHttp.post('/api/im/app/addressList', {userName: 'name', password: '123456'}, {
|
||||
customHttp.customHttp.get('/api/im/app/addressList', {
|
||||
params: {}, /* 会加在url上 */
|
||||
header: {}, /* 会与全局header合并,如有同名属性,局部覆盖全局 */
|
||||
dataType: 'json',
|
||||
// 注:如果局部custom与全局custom有同名属性,则后面的属性会覆盖前面的属性,相当于Object.assign(全局,局部)
|
||||
custom: {target: "znzq"} // 可以加一些自定义参数,在拦截器等地方使用。比如这里我加了一个auth,可在拦截器里拿到,如果true就传token
|
||||
custom: {target: "znzq"} , // 可以加一些自定义参数,在拦截器等地方使用。比如这里我加了一个auth,可在拦截器里拿到,如果true就传token
|
||||
}).then(res => {
|
||||
|
||||
console.log("=========获取到数据")
|
||||
console.log(res)
|
||||
if(res.statusCode==200){
|
||||
if(res.data.code==200){
|
||||
var list=[]
|
||||
res.data.result.records.map((item)=>{
|
||||
console.log(item)
|
||||
list.push({
|
||||
name:item.realname,
|
||||
avatar:item.portrait,
|
||||
userId:item.userId,
|
||||
userType:1,
|
||||
chatNo:item.userId
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
this.list=this.$fc.sortList({list:list,key:'name'})
|
||||
|
||||
}
|
||||
}
|
||||
}).catch(err => {
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
this.$http.request({
|
||||
url: '/friend/friendList',
|
||||
method: 'POST',
|
||||
@@ -99,7 +127,8 @@
|
||||
this.list=this.$fc.sortList({list:list,key:'name'})
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
*/
|
||||
},
|
||||
},
|
||||
onNavigationBarButtonTap(e) {
|
||||
|
||||
Reference in New Issue
Block a user