Commit 2499685a by RuoYi

如果加载头像时发生了错误,则显示一个默认头像

parent a3bb6033
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<a class="menuItem noactive" title="个人中心" th:href="@{/system/user/profile}"> <a class="menuItem noactive" title="个人中心" th:href="@{/system/user/profile}">
<div class="hide" th:text="个人中心"></div> <div class="hide" th:text="个人中心"></div>
<div class="pull-left image"> <div class="pull-left image">
<img th:src="(${user.avatar} == '') ? @{/img/profile.jpg} : @{${user.avatar}}" class="img-circle" alt="User Image"> <img th:src="(${user.avatar} == '') ? @{/img/profile.jpg} : @{${user.avatar}}" th:onerror="this.src='img/profile.jpg'" class="img-circle" alt="User Image">
</div> </div>
</a> </a>
<div class="pull-left info"> <div class="pull-left info">
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
<li><a title="全屏显示" href="javascript:void(0)" id="fullScreen"><i class="fa fa-arrows-alt"></i> 全屏显示</a></li> <li><a title="全屏显示" href="javascript:void(0)" id="fullScreen"><i class="fa fa-arrows-alt"></i> 全屏显示</a></li>
<li class="dropdown user-menu"> <li class="dropdown user-menu">
<a href="javascript:void(0)" class="dropdown-toggle" data-hover="dropdown"> <a href="javascript:void(0)" class="dropdown-toggle" data-hover="dropdown">
<img th:src="(${user.avatar} == '') ? @{/img/profile.jpg} : @{${user.avatar}}" class="user-image"> <img th:src="(${user.avatar} == '') ? @{/img/profile.jpg} : @{${user.avatar}}" th:onerror="this.src='img/profile.jpg'" class="user-image">
<span class="hidden-xs">[[${#strings.defaultString(user.userName, '-')}]]</span> <span class="hidden-xs">[[${#strings.defaultString(user.userName, '-')}]]</span>
</a> </a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
......
...@@ -25,7 +25,7 @@ public @interface Excel ...@@ -25,7 +25,7 @@ public @interface Excel
public String dateFormat() default ""; public String dateFormat() default "";
/** /**
* 如果是字典类型,请设置字典的type值 * 如果是字典类型,请设置字典的type值 (如: sys_user_sex)
*/ */
public String dictType() default ""; public String dictType() default "";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment