update send email verify ttl 300 sec

This commit is contained in:
Tokumeikoi
2020-03-13 14:32:36 +08:00
parent 01da63f82e
commit 13dbb143f8
3 changed files with 21 additions and 10 deletions

View File

@ -4,5 +4,16 @@ namespace App\Utils;
class CacheKey
{
CONST KEYS = [
'EMAIL_VERIFY_CODE' => '邮箱验证吗',
'LAST_SEND_EMAIL_VERIFY_TIMESTAMP' => '最后一次发送邮箱验证码时间'
];
public static function get(string $key, $uniqueValue)
{
if (!in_array($key, array_keys(self::KEYS))) {
abort(500, 'key is not in cache key list');
}
return $key . '_' . $uniqueValue;
}
}