Browse Source

feat: remove querystring

pull/11428/head
ian 1 year ago
parent
commit
c115c34bcf
  1. 1
      .gitignore
  2. 4
      mock/user.ts
  3. 1
      package.json
  4. 7
      src/components/RightContent/AvatarDropdown.tsx

1
.gitignore

@ -39,3 +39,4 @@ screenshot
.eslintcache
build
bun.lock

4
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);

1
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"
},

7
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<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(),
});
}
};

Loading…
Cancel
Save