1,通路的接口:
2,使用者名:data.name
3,頭像:data.headpictrue
4,預設圖形:webroot + '/images/workbench/user.png'
如果沒有頭像:
![](https://img.laitimes.com/img/_0nNw4CM6IyYiwiM6ICdiwiIn5GcuIXY0N3Xu92Yp9CXzV2Zh1WavwVbvNmLllXZ0lmL3gjN5gzN3gjMxcHavw1LcpDc0RHaiojIsJye.png)
if($("#headlogo").length > 0){
var defaultimg=webroot + '/images/workbench/user.png';
$('#headlogo')[0].onerror = function(){
this.src = defaultimg;
};
var headpictrue=data.headpictrue;
if(!headpictrue){
//console.log('data.headpictrue is empty.');
headpictrue=defaultimg;
}
$('#headlogo').attr('src' , headpictrue);
}