Browse Source

配置context-path默认图片加载问题.

pull/27/head
RuoYi 6 years ago
parent
commit
e1c7db101c
  1. 2
      src/main/resources/templates/index.html
  2. 2
      src/main/resources/templates/system/user/profile/avatar.html
  3. 2
      src/main/resources/templates/system/user/profile/profile.html

2
src/main/resources/templates/index.html

@ -32,7 +32,7 @@
<ul class="nav" id="side-menu">
<li class="nav-header">
<div class="dropdown profile-element"> <span>
<img th:src="(${user.avatar} == '') ? '/img/profile.jpg' : '/profile/avatar/' + ${user.avatar}" alt="image" class="img-circle" height="60" width="60"/></span>
<img th:src="(${user.avatar} == '') ? @{/img/profile.jpg} : @{/profile/avatar/} + ${user.avatar}" alt="image" class="img-circle" height="60" width="60"/></span>
<a data-toggle="dropdown" class="dropdown-toggle" href="#">
<span class="clear"><span class="block m-t-xs"><strong class="font-bold" th:text="${user.userName}">用户</strong></span>
<span class="text-muted text-xs block"><span th:text="${user.dept?.deptName}">部门</span> <b class="caret"></b></span> </span> </a>

2
src/main/resources/templates/system/user/profile/avatar.html

@ -30,7 +30,7 @@ $(window).load(function() {
var options = {
thumbBox: '.thumbBox',
spinner: '.spinner',
imgSrc: $.common.isEmpty(avatar) ? '/img/profile.jpg' : '/profile/avatar/' + avatar
imgSrc: $.common.isEmpty(avatar) ? ctx + 'img/profile.jpg' : ctx + 'profile/avatar/' + avatar
}
var cropper = $('.imageBox').cropbox(options);
$('#avatar').on('change',

2
src/main/resources/templates/system/user/profile/profile.html

@ -35,7 +35,7 @@
<div class="contact-box">
<div class="col-sm-4">
<div class="text-center">
<img alt="image" class="img-circle m-t-xs img-responsive" th:src="(${user.avatar} == '') ? '/img/profile.jpg' : '/profile/avatar/' + ${user.avatar}">
<img alt="image" class="img-circle m-t-xs img-responsive" th:src="(${user.avatar} == '') ? @{/img/profile.jpg} : @{/profile/avatar/} + ${user.avatar}">
<div class="m-t-xs font-bold">[[${user.loginIp}]]</div>
</div>
</div>

Loading…
Cancel
Save