fix(auth): 修复师傅端上传身份证报请先登录错误与PHP8兼容性

- 修复 addons/cos/library/Auth.php 仅校验用户端登录态导致师傅端Token被误拒的问题,支持MasterAuth多端鉴权
- 增强 api/controller/Common.php upload 方法获取 token 支持 header 读取
- 优化 fast/Random.php uuid 方法采用RFC4122原生random_bytes实现,规避PHP8.4+下Ramsey\\Uuid可空参数弃用异常
这个提交包含在:
2026-11-24 15:46:54 +08:00
父节点 53252d6d87
当前提交 62150d261a
共有 3 个文件被更改,包括 27 次插入 和 4 次删除

查看文件

@@ -97,6 +97,13 @@ class Random
*/
public static function uuid(): string
{
return Uuid::uuid4()->toString();
try {
$data = random_bytes(16);
$data[6] = chr(ord($data[6]) & 0x0f | 0x40);
$data[8] = chr(ord($data[8]) & 0x3f | 0x80);
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
} catch (\Throwable $e) {
return Uuid::uuid4()->toString();
}
}
}