🎨 改进 token 生成方式

This commit is contained in:
WispX
2020-03-16 14:57:41 +08:00
parent 243587450b
commit 3e083ff453
+5 -1
View File
@@ -118,7 +118,11 @@ function str_rand($length = 16, $char = '0123456789abcdefghijklmnopqrstuvwxyzABC
*/
function make_token()
{
return md5('LSKY PRO' . uniqid() . time());
$token = md5('LSKY PRO' . uniqid() . time());
if (\app\common\model\Users::where('token', $token)->count()) {
return make_token();
}
return $token;
}
/**