feat: attachment viewing function (#58)

This commit is contained in:
Dream Hunter
2024-01-13 23:57:52 +08:00
committed by GitHub
parent 2952a641a5
commit 97a1f0a968
11 changed files with 604 additions and 472 deletions

View File

@@ -25,11 +25,11 @@ const apiFetch = async (path, options = {}) => {
});
if (response.status === 401 && openSettings.value.auth) {
showAuth.value = true;
throw new Error("Unauthorized");
throw new Error("Unauthorized, you password is wrong")
}
if (response.status === 401 && path.startsWith("/admin")) {
showAdminAuth.value = true;
throw new Error("Unauthorized");
throw new Error("Unauthorized, you admin password is wrong")
}
if (response.status >= 300) {
throw new Error(`${response.status} ${response.data}` || "error");