diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index dfbb53c0..f5993e94 100644 --- a/src/main/resources/templates/index.html +++ b/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> diff --git a/src/main/resources/templates/system/user/profile/avatar.html b/src/main/resources/templates/system/user/profile/avatar.html index d2c52ee0..a795e54e 100644 --- a/src/main/resources/templates/system/user/profile/avatar.html +++ b/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', diff --git a/src/main/resources/templates/system/user/profile/profile.html b/src/main/resources/templates/system/user/profile/profile.html index 52f6759d..8862c3a0 100644 --- a/src/main/resources/templates/system/user/profile/profile.html +++ b/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>