Commit 1cb672f8 by RuoYi

修改头像显示当前图片

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