* Finish task #41437.

This commit is contained in:
holan20180123
2021-08-16 10:30:10 +08:00
parent c1bc10b477
commit 836a0bacd6
3 changed files with 13 additions and 6 deletions
+10 -6
View File
@@ -3,21 +3,25 @@ $(document).ready(function()
$('#files').change(function(){$('#avatarForm').submit();});
$.setAjaxForm('#avatarForm', function(response)
{
{
if(response.result == 'success')
{
{
setTimeout(function()
{
{
$('#avatarUploadBtn').popover('destroy');
$('#ajaxModal').load(response.locate);
}, 800);
}
});
}
});
$('#avatarUploadBtn').on('click', function()
{
{
$('#files').click();
});
window.parent.$('#main-avatar, #menu-avatar').html('<img src="' + avatar + '"/>');
window.parent.$('#mainContent>.cell>.main-header>.avatar').html('<img src="' + avatar + '"/>');
window.parent.$('#mainContent .avatar-' + account).html('<img src="' + avatar + '"/>');
});
function uploadAvatar()
+2
View File
@@ -11,6 +11,8 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('avatar', $this->app->user->avatar);?>
<?php js::set('account', $this->app->user->account);?>
<div id='mainContent'>
<div class='cell'>
<div class='main-header text-center'>
+1
View File
@@ -1141,6 +1141,7 @@ class user extends control
$this->app->user->avatar = $image->webPath;
$this->session->set('user', $this->app->user);
$this->dao->update(TABLE_USER)->set('avatar')->eq($image->webPath)->where('account')->eq($this->app->user->account)->exec();
exit('success');
}