diff --git a/.gitignore b/.gitignore index 0fb3670732..73a523301c 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ screenshot .eslintcache build +bun.lock \ No newline at end of file diff --git a/mock/user.ts b/mock/user.ts index 75edd34042..9e1a6c52a8 100644 --- a/mock/user.ts +++ b/mock/user.ts @@ -1,6 +1,6 @@ -import { Request, Response } from 'express'; +import type { Request, Response } from 'express'; -const waitTime = (time: number = 100) => { +const waitTime = (time = 100) => { return new Promise((resolve) => { setTimeout(() => { resolve(true); diff --git a/package.json b/package.json index 88424cc51c..c897a783f7 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "antd-style": "^3.7.0", "classnames": "^2.5.1", "dayjs": "^1.11.13", - "querystring": "^0.2.1", "react": "^18.3.1", "react-dom": "^18.3.1" }, diff --git a/src/components/RightContent/AvatarDropdown.tsx b/src/components/RightContent/AvatarDropdown.tsx index fe30b2f9e6..eb6d5e599f 100644 --- a/src/components/RightContent/AvatarDropdown.tsx +++ b/src/components/RightContent/AvatarDropdown.tsx @@ -4,8 +4,7 @@ import { history, useModel } from '@umijs/max'; import { Spin } from 'antd'; import type { MenuProps } from 'antd'; import { createStyles } from 'antd-style'; -import { stringify } from 'querystring'; -import React from 'react'; +import type React from 'react'; import { flushSync } from 'react-dom'; import HeaderDropdown from '../HeaderDropdown'; @@ -52,9 +51,7 @@ export const AvatarDropdown: React.FC = ({ menu, childre if (window.location.pathname !== '/user/login' && !redirect) { history.replace({ pathname: '/user/login', - search: stringify({ - redirect: pathname + search, - }), + search: new URLSearchParams(`redirect=${pathname}${search}`).toString(), }); } };