Fix deploy.sh CRLF line endings for Linux compatibility
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+35
-35
@@ -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;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user