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:
wolfcode
2025-06-18 11:51:12 +08:00
parent 216ca6e697
commit 4ed8237a00
4 changed files with 7 additions and 7 deletions

View File

@@ -109,7 +109,7 @@ class Index extends AdminController
try {
$save = $row->save([
'password' => password($post['password']),
'password' => password_hash($post['password'], PASSWORD_DEFAULT),
]);
}catch (Exception $e) {
$this->error('保存失败');