first commit

This commit is contained in:
wushumin
2026-04-16 11:17:18 +08:00
commit 5b9c398e68
98 changed files with 8701 additions and 0 deletions

25
support/helpers.php Normal file
View File

@@ -0,0 +1,25 @@
<?php
if (!function_exists('jsonResponse')) {
function jsonResponse($data = [], $msg = 'success', $code = 200)
{
return json([
'code' => $code,
'msg' => $msg,
'data' => $data
]);
}
}
if (!function_exists('generateToken')) {
function generateToken(): string
{
return bin2hex(random_bytes(32));
}
}
if (!function_exists('hashToken')) {
function hashToken(string $token): string
{
return hash('sha256', $token);
}
}