<img class="user-avatar" id="user-avatar" :src="userInfo.headPic"/>
import avatar from "../images/avatar.png";
userInfo() {
如果前5位字符没有http 的请求 就返回本地的默认图片
if (this.$store.state.userInfo.headPic.substr(0,4) != "http") {
this.$store.state.userInfo.headPic = avatar;
}
//如果 前5位没有http 的请求就返回接口上传的图片
return this.$store.state.userInfo;
},