default avatar

This commit is contained in:
xaoxuu 2022-10-29 18:11:25 +08:00
parent 63ceaf5352
commit e929a33351
1 changed files with 6 additions and 5 deletions

View File

@ -56,7 +56,7 @@ const FCircle = {
var cell = '<div class="timenode" index="' + i + '">'; var cell = '<div class="timenode" index="' + i + '">';
cell += '<div class="header">'; cell += '<div class="header">';
cell += '<div class="user-info">'; cell += '<div class="user-info">';
cell += '<img src="' + item.avatar + '">'; cell += '<img src="' + (item.avatar || cfg.avatar) + '" onerror="javascript:this.src=\'' + cfg.avatar + '\';">';
cell += '<span>' + item.author + '</span>'; cell += '<span>' + item.author + '</span>';
cell += '</div>'; cell += '</div>';
cell += '<p>' + item.updated + '</p>'; cell += '<p>' + item.updated + '</p>';
@ -83,9 +83,10 @@ $(function () {
if (api == null) { if (api == null) {
continue; continue;
} }
var obj = new Object(); var cfg = new Object();
obj.el = el; cfg.el = el;
obj.api = api; cfg.api = api;
FCircle.layoutDiv(obj); cfg.avatar = 'https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/avatar/round/3442075.svg';
FCircle.layoutDiv(cfg);
} }
}); });