init: 0.1.1

feat: login page && auth required
todo: 断点上传
This commit is contained in:
loveuer
2025-05-08 18:02:49 +08:00
parent b3ff70167f
commit a2635698e0
18 changed files with 677 additions and 35 deletions

View File

@ -1,5 +1,6 @@
import { useState } from 'react';
interface UploadRes {
code: string
}
@ -25,6 +26,12 @@ export const useFileUpload = () => {
});
if (!res1.ok) {
console.log(`[D] upload: put file not ok, status = ${res1.status}, res = ${await res1.text()}`)
if (res1.status === 401) {
window.location.href = "/login?next=/share"
return ""
}
throw new Error("上传失败<1>");
}