build: format the code with prettier

This commit is contained in:
Tristan Yang
2023-05-19 16:31:28 +08:00
parent 7afc132bbb
commit 5bd0183651
259 changed files with 7627 additions and 5607 deletions
+6 -2
View File
@@ -1,5 +1,6 @@
import { FC, ReactElement } from "react";
import { Navigate, useLocation, matchRoutes } from "react-router-dom";
import { matchRoutes, Navigate, useLocation } from "react-router-dom";
import { GuestRoutes, KEY_LOCAL_TRY_PATH } from "@/app/config";
import { useGetInitializedQuery } from "@/app/services/auth";
import { useGetLoginConfigQuery } from "@/app/services/server";
@@ -34,7 +35,10 @@ const RequireAuth: FC<Props> = ({ children, redirectTo = "/login" }) => {
if (!token) {
// 记录下当前的路径,登录后跳转回来
const ignorePath = `/setting/my_account`;
localStorage.setItem(KEY_LOCAL_TRY_PATH, ignorePath == location.pathname ? "/" : `${location.pathname}${location.search}`);
localStorage.setItem(
KEY_LOCAL_TRY_PATH,
ignorePath == location.pathname ? "/" : `${location.pathname}${location.search}`
);
return <Navigate to={redirectTo} replace />;
}
const tryPath = localStorage.getItem(KEY_LOCAL_TRY_PATH);