forked from XiaoLFeng/XF_Index
Token创建审核规则优化
This commit is contained in:
parent
909cd1e0dc
commit
c1658a8525
@ -11,17 +11,14 @@ class Token
|
||||
public int $Data_TokenLong;
|
||||
/** @var string 生成的Token或获取的Token */
|
||||
public ?string $Data_Token = null;
|
||||
/** @var bool 检查是否是Token创建模式 */
|
||||
public bool $Data_TokenCreate;
|
||||
|
||||
/**
|
||||
* @param int|null $Token_Long 获取Token计算长度
|
||||
* @param bool $Token_Create 是否为 Token 创建模式
|
||||
*/
|
||||
public function __construct(int $Token_Long, bool $Token_Create)
|
||||
public function __construct(int $Token_Long)
|
||||
{
|
||||
$this->Data_TokenLong = $Token_Long;
|
||||
$this->Data_TokenCreate = $Token_Create;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -76,8 +73,6 @@ public function getToken(): string
|
||||
*/
|
||||
private function checkToken(): string
|
||||
{
|
||||
if (!$this->Data_TokenCreate)
|
||||
return "NotAvailable";
|
||||
if ($this->Data_TokenLong < 5)
|
||||
return "TokenTooShort";
|
||||
else if ($this->Data_TokenLong > 40)
|
||||
|
Loading…
x
Reference in New Issue
Block a user