feat: admin login

This commit is contained in:
2024-10-27 00:34:45 +08:00
parent 3a39ff3790
commit d76e37a81d
18 changed files with 698 additions and 3 deletions

View File

@@ -0,0 +1,42 @@
<?php
namespace App\Lib\Crypto;
use Exception;
class AdminPasswordCrypto implements CryptoInterface
{
/**
* 明文密码
* @var string
*/
public string $data = '';
/**
* 加密盐
* @var string
*/
public string $salt = '';
/**
* admin password 加密
* @return string
*/
public function encrypt(): string
{
try {
return hash("sha256", $this->salt . hash("sha256", $this->salt . $this->data));
} catch (Exception) {
return '';
}
}
/**
* 解密 不需要解密
* @return string
*/
public function decrypt(): string
{
return '';
}
}