Skip to content

Commit

Permalink
feat: remove querystring
Browse files Browse the repository at this point in the history
  • Loading branch information
ianzone committed Feb 4, 2025
1 parent aed9481 commit c115c34
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ screenshot
.eslintcache

build
bun.lock
4 changes: 2 additions & 2 deletions mock/user.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
7 changes: 2 additions & 5 deletions src/components/RightContent/AvatarDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -52,9 +51,7 @@ export const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ 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(),
});
}
};
Expand Down

0 comments on commit c115c34

Please sign in to comment.