Fix deploy.sh CRLF line endings for Linux compatibility

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-27 10:59:59 +08:00
parent 65f5caf4d9
commit b9ee546bc1
20 changed files with 2142 additions and 2118 deletions
+35 -35
View File
@@ -1,35 +1,35 @@
const AUTH = {
async me() {
const res = await fetch("/api/auth/me", { credentials: "include" });
if (!res.ok) return null;
return res.json();
},
async login(username, password) {
const res = await fetch("/api/auth/login", {
method: "POST",
credentials: "include",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ username, password }),
});
const data = await res.json().catch(() => ({}));
if (!res.ok) throw new Error(data.detail || "登录失败");
return data;
},
async logout() {
await fetch("/api/auth/logout", { method: "POST", credentials: "include" });
},
async changeCredentials(payload) {
const res = await fetch("/api/auth/change-credentials", {
method: "POST",
credentials: "include",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload),
});
const data = await res.json().catch(() => ({}));
if (!res.ok) throw new Error(data.detail || "修改失败");
return data;
},
};
const AUTH = {
async me() {
const res = await fetch("/api/auth/me", { credentials: "include" });
if (!res.ok) return null;
return res.json();
},
async login(username, password) {
const res = await fetch("/api/auth/login", {
method: "POST",
credentials: "include",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ username, password }),
});
const data = await res.json().catch(() => ({}));
if (!res.ok) throw new Error(data.detail || "登录失败");
return data;
},
async logout() {
await fetch("/api/auth/logout", { method: "POST", credentials: "include" });
},
async changeCredentials(payload) {
const res = await fetch("/api/auth/change-credentials", {
method: "POST",
credentials: "include",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload),
});
const data = await res.json().catch(() => ({}));
if (!res.ok) throw new Error(data.detail || "修改失败");
return data;
},
};