User Center

This commit is contained in:
2024-01-31 21:16:54 +08:00
parent e9762d5e70
commit d4e437624a
10 changed files with 188 additions and 23 deletions

View File

@@ -39,8 +39,8 @@ export async function refreshAtk() {
console.error(await res.text())
} else {
const data = await res.json();
new Cookie().set("access_token", data["access_token"], { path: "/" });
new Cookie().set("refresh_token", data["refresh_token"], { path: "/" });
new Cookie().set("access_token", data["access_token"], { path: "/", maxAge: undefined });
new Cookie().set("refresh_token", data["refresh_token"], { path: "/", maxAge: undefined });
}
}
@@ -77,8 +77,8 @@ export async function readProfiles(recovering = true) {
}
export function clearUserinfo() {
new Cookie().remove("access_token", { path: "/" });
new Cookie().remove("refresh_token", { path: "/" });
new Cookie().remove("access_token", { path: "/", maxAge: undefined });
new Cookie().remove("refresh_token", { path: "/", maxAge: undefined });
setUserinfo(defaultUserinfo);
}