diff --git a/app/admin/controller/Index.php b/app/admin/controller/Index.php index 03a5e16fb..73ee223f5 100644 --- a/app/admin/controller/Index.php +++ b/app/admin/controller/Index.php @@ -57,7 +57,7 @@ class Index extends Controller public function info($id = 0) { $this->_applyFormToken(); - if (intval($this->app->session->get('user.id')) === intval($id)) { + if (AdminService::instance()->getUserId() === intval($id)) { $this->_form('SystemUser', 'admin@user/form', 'id', [], ['id' => $id]); } else { $this->error('只能修改登录用户的资料!'); @@ -75,7 +75,7 @@ class Index extends Controller public function pass($id = 0) { $this->_applyFormToken(); - if (intval($this->app->session->get('user.id')) !== intval($id)) { + if (AdminService::instance()->getUserId() !== intval($id)) { $this->error('只能修改当前用户的密码!'); } if ($this->app->request->isGet()) { diff --git a/vendor/services.php b/vendor/services.php index fb2f3687c..bdfceb91e 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\app\\Service',