diff --git a/Application/Base/Service/UserService.class.php b/Application/Base/Service/UserService.class.php index fc5350e3..1ee933e9 100644 --- a/Application/Base/Service/UserService.class.php +++ b/Application/Base/Service/UserService.class.php @@ -88,7 +88,7 @@ class UserService if (empty($user) || $user['lock_status'] != 1 && $user['check_status'] != 1) { return ['status' => false, 'message' => '账号或密码错误']; } - if (think_ucenter_md5($password, UC_AUTH_KEY) === $user['password']) { + if ($this->password($password, UC_AUTH_KEY) === $user['password']) { return ['status' => false, 'message' => '账号或密码错误']; } @@ -384,4 +384,8 @@ class UserService Redis::decr(Redis::KEY_LOGIN_LIMIT); } } + + public function password($str, $key = 'ThinkUCenter'){ + return '' === $str ? '' : md5(sha1($str) . $key); + } } \ No newline at end of file