mirror of https://gitee.com/karson/fastadmin.git
修复后台个人资料的BUG
parent
56df37472b
commit
d03b1c5fb0
|
|
@ -3,6 +3,7 @@
|
||||||
namespace app\admin\controller\general;
|
namespace app\admin\controller\general;
|
||||||
|
|
||||||
use app\common\controller\Backend;
|
use app\common\controller\Backend;
|
||||||
|
use fast\Random;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 个人配置
|
* 个人配置
|
||||||
|
|
@ -53,13 +54,13 @@ class Profile extends Backend
|
||||||
unset($v);
|
unset($v);
|
||||||
if (isset($params['password']))
|
if (isset($params['password']))
|
||||||
{
|
{
|
||||||
$params['salt'] = Random::basic(4);
|
$params['salt'] = Random::alnum();
|
||||||
$params['password'] = md5(md5($params['password']) . $params['salt']);
|
$params['password'] = md5(md5($params['password']) . $params['salt']);
|
||||||
}
|
}
|
||||||
if ($params)
|
if ($params)
|
||||||
{
|
{
|
||||||
model('admin')->where('id', Auth::id())->update($params);
|
model('admin')->where('id', $this->auth->id)->update($params);
|
||||||
$this->code = 0;
|
$this->code = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
{:__('Profile')}
|
{:__('Profile')}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<form id="update-form" role="form" data-toggle="validator" method="POST" action="/general_profile/update">
|
<form id="update-form" role="form" data-toggle="validator" method="POST" action="{:url('general.profile/update')}">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="username" class="control-label">{:__('Username')}:</label>
|
<label for="username" class="control-label">{:__('Username')}:</label>
|
||||||
<input type="text" class="form-control" name="row[username]" value="{$admin.username}" disabled />
|
<input type="text" class="form-control" name="row[username]" value="{$admin.username}" disabled />
|
||||||
|
|
|
||||||
|
|
@ -37,14 +37,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||||
// 为表格绑定事件
|
// 为表格绑定事件
|
||||||
Table.api.bindevent(table);//当内容渲染完成后
|
Table.api.bindevent(table);//当内容渲染完成后
|
||||||
|
|
||||||
Form.api.bindevent($("#update-form"));
|
Form.api.bindevent($("#update-form"), null, function () {
|
||||||
|
$("input[name='row[password]']").val('');
|
||||||
$("#update-form").submit(function () {
|
return true;
|
||||||
Form.api.submit($("#update-form"), null, function () {
|
|
||||||
$("input[name='row[password]']").val('');
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue