From 4058eb3963fdd8df46a0f1effcc85bebac7998f6 Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Sun, 28 Jun 2020 11:00:09 +0800 Subject: [PATCH 1/2] 1 --- Application/Home/Controller/SafeController.class.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Application/Home/Controller/SafeController.class.php b/Application/Home/Controller/SafeController.class.php index 1f55f2cdb..0891a3690 100644 --- a/Application/Home/Controller/SafeController.class.php +++ b/Application/Home/Controller/SafeController.class.php @@ -99,6 +99,7 @@ class SafeController extends BaseController{ // if(empty($oldpwd)) { // $this->error("旧密码不能为空"); // } + $this->checkPaswwordFormat($safepwd); if(empty($safepwd)) { $this->error("安全密码不能为空"); } @@ -107,12 +108,8 @@ class SafeController extends BaseController{ } $id = get_pid(); $data['second_pwd'] = $this->think_ucenter_md5($safepwd, UC_AUTH_KEY); - $updateRs = M("promote","tab_")->where(['id'=>$id])->save($data); - if($updateRs) { - $this->success("修改成功"); - }else { - $this->error("修改失败,请重新操作"); - } + M("promote","tab_")->where(['id'=>$id])->save($data); + $this->success("修改成功"); } $this->display(); From 2680f92079fd3424065c4d15e62ee943d0d04aaf Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Sun, 28 Jun 2020 11:28:48 +0800 Subject: [PATCH 2/2] 1 --- Application/Home/Controller/SafeController.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Application/Home/Controller/SafeController.class.php b/Application/Home/Controller/SafeController.class.php index 0891a3690..aa37c1988 100644 --- a/Application/Home/Controller/SafeController.class.php +++ b/Application/Home/Controller/SafeController.class.php @@ -54,11 +54,9 @@ class SafeController extends BaseController{ $this->checkPaswwordFormat($confirmpassword); $data['second_pwd'] = $this->think_ucenter_md5($confirmpassword, UC_AUTH_KEY); $id = get_pid(); - $updateRs = M("promote","tab_")->where(['id'=>$id])->save($data); - if($updateRs) { - recordPromoteLogs('安全管理','设置安全密码'); - $this->success("安全密码设置成功"); - } + M("promote","tab_")->where(['id'=>$id])->save($data); + recordPromoteLogs('安全管理','设置安全密码'); + $this->success("安全密码设置成功"); } public function think_ucenter_md5($str, $key = 'ThinkUCenter')