Skip to content

Commit

Permalink
fix: Use new user-info
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeZhangBorui committed Nov 15, 2024
1 parent 71ca849 commit c75e03c
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions components/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,11 @@ export const Navbar = () => {

useEffect(() => {
async function fetchData() {
fetch("/login-check", { mode: "no-cors", method: "get" })
fetch("/wp-json/hjmc/v1/user-info", { mode: "no-cors", method: "get" })
.then((response) => response.json())
.then((data: { login: boolean }) => {
setLogin(data.login);
// console.log("用户登陆状态", data);
.then((data: { success: boolean }) => {
setLogin(data.success);
});
// .catch((e) => {
// console.error(e);
// console.warn("Navbar可能无法正常工作!");
// });
}
fetchData();
});
Expand Down

0 comments on commit c75e03c

Please sign in to comment.