refactor(auth): upgrade password hashing to PHP's password_hash
- Replace custom password hashing function with PHP's built-in password_hash - Update password verification to use password_verify - Adjust database schema to accommodate new password hash length - Modify installation and login controllers to use new hashing method
This commit is contained in:
@@ -53,7 +53,7 @@ class Login extends AdminController
|
||||
if (empty($admin)) {
|
||||
$this->error('用户不存在');
|
||||
}
|
||||
if (password($post['password']) != $admin->password) {
|
||||
if (!password_verify($post['password'], $admin->password)) {
|
||||
$this->error('密码输入有误');
|
||||
}
|
||||
if ($admin->status == 0) {
|
||||
|
||||
Reference in New Issue
Block a user