上传文件修改为返回完整路径

This commit is contained in:
RuoYi
2019-07-11 10:53:18 +08:00
parent 8dfa1834e3
commit 304da21e6d
6 changed files with 9 additions and 14 deletions

View File

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

View File

@@ -15,7 +15,7 @@
</div>
<div class="ibox-content">
<div class="text-center">
<p><img class="img-circle img-lg" th:src="(${user.avatar} == '') ? @{/img/profile.jpg} : @{/profile/avatar/} + ${user.avatar}"></p>
<p><img class="img-circle img-lg" th:src="(${user.avatar} == '') ? @{/img/profile.jpg} : @{${user.avatar}}"></p>
<p><a href="javascript:avatar()">修改头像</a></p>
</div>
<ul class="list-group list-group-striped">