feat: Oauth update

This commit is contained in:
landaiqing
2024-05-27 23:42:30 +08:00
parent 90a1c1f3ce
commit ce246ae2fe
8 changed files with 64 additions and 55 deletions

View File

@@ -5,6 +5,7 @@ import "./index.less";
import { useNavigate, useSearchParams } from "react-router-dom";
import useStore from "@/utils/store/useStore.tsx";
import { observer } from "mobx-react";
import localforage from "localforage";
const LoadingPage = () => {
const [search] = useSearchParams();
@@ -14,6 +15,7 @@ const LoadingPage = () => {
const store = useStore("user");
store.setToken(token);
store.setUserId(userId);
localforage.setItem("token", token).then();
useEffect(() => {
document.body.classList.add("loading-body");
if (store.getToken() !== null && store.getUserId() !== null) {