修改头像显示当前图片

pull/25/head
RuoYi 2018-09-04 13:14:46 +08:00
parent 4fe158fa94
commit 1cb672f8bd
1 changed files with 2 additions and 1 deletions

View File

@ -26,10 +26,11 @@
<script th:src="@{/ajax/libs/cropbox/cropbox.js}"></script>
<script type="text/javascript">
$(window).load(function() {
var avatar = '[[${user.avatar}]]';
var options = {
thumbBox: '.thumbBox',
spinner: '.spinner',
imgSrc: '/img/profile.jpg'
imgSrc: $.common.isEmpty(avatar) ? '/img/profile.jpg' : '/profile/' + avatar
}
var cropper = $('.imageBox').cropbox(options);
$('#avatar').on('change',