图床上传
平台签发预签名上传 URL,客户端直传对象存储(上传带宽不经平台),读图走 static. CDN。
GET
/api/v1/storage/config无查询开关、大小/配额限制、public_base
站点直传(X-Api-Key)
POST
/api/v1/storage/open/presignX-Api-Key · storage签发预签名上传 URL
请求
{
"filename": "a.webp",
"content_type": "image/webp",
"content_length": 20480,
"subdir": "avatars"
}响应
{
"key": "prefix/your-slug/avatars/uuid.webp",
"put_url": "https://<预签名直传地址>/...",
"url": "https://static.rekitdev.com/...",
"unsigned_url": "https://static.rekitdev.com/...",
"expires_in": 300
}- 1调 presign 拿
put_url(有效期 300s)。 - 2客户端
PUT put_url,请求体为文件字节,Content-Type与请求一致。 - 3读图用返回的
url(站点开通 CDN 鉴权时为签名 URL)或unsigned_url。
登录用户直传(Bearer)
POST
/api/v1/storage/presignBearer登录用户预签名,计入用户配额(返回 quota)
content_length 必传,用于大小/配额校验;单文件与用户总配额上限见 storage/config。