From d03b1c5fb0c593240da171aeb79d614e82e3c096 Mon Sep 17 00:00:00 2001 From: Karson Date: Tue, 11 Apr 2017 23:50:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8E=E5=8F=B0=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E8=B5=84=E6=96=99=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/general/Profile.php | 7 ++++--- application/admin/view/general/profile/index.html | 2 +- public/assets/js/backend/general/profile.js | 11 +++-------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/application/admin/controller/general/Profile.php b/application/admin/controller/general/Profile.php index fffd6394..6b37145d 100644 --- a/application/admin/controller/general/Profile.php +++ b/application/admin/controller/general/Profile.php @@ -3,6 +3,7 @@ namespace app\admin\controller\general; use app\common\controller\Backend; +use fast\Random; /** * 个人配置 @@ -53,13 +54,13 @@ class Profile extends Backend unset($v); if (isset($params['password'])) { - $params['salt'] = Random::basic(4); + $params['salt'] = Random::alnum(); $params['password'] = md5(md5($params['password']) . $params['salt']); } if ($params) { - model('admin')->where('id', Auth::id())->update($params); - $this->code = 0; + model('admin')->where('id', $this->auth->id)->update($params); + $this->code = 1; } } return; diff --git a/application/admin/view/general/profile/index.html b/application/admin/view/general/profile/index.html index 47b2f514..7a53ac8e 100644 --- a/application/admin/view/general/profile/index.html +++ b/application/admin/view/general/profile/index.html @@ -5,7 +5,7 @@ {:__('Profile')}
-
+
diff --git a/public/assets/js/backend/general/profile.js b/public/assets/js/backend/general/profile.js index c9db495d..dc72b5ea 100755 --- a/public/assets/js/backend/general/profile.js +++ b/public/assets/js/backend/general/profile.js @@ -37,14 +37,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // 为表格绑定事件 Table.api.bindevent(table);//当内容渲染完成后 - Form.api.bindevent($("#update-form")); - - $("#update-form").submit(function () { - Form.api.submit($("#update-form"), null, function () { - $("input[name='row[password]']").val(''); - return true; - }); - return false; + Form.api.bindevent($("#update-form"), null, function () { + $("input[name='row[password]']").val(''); + return true; }); } };