How to use the umi.history.replace function in umi

To help you get started, we’ve selected a few umi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apache / apisix-dashboard / web / src / pages / User / Login.tsx View on Github external
},
            });
          }
        });
      }
    });
  };

  const onKeyDown = (event: React.KeyboardEvent) => {
    if (event.key === 'Enter') {
      onSubmit();
    }
  }

  if (localStorage.getItem('token')) {
    history.replace('/');
    return null;
  }
  return (
    <div>
      <div>
        <div>
          <a href="https://apisix.apache.org">
            
          </a>
        </div>
        
      </div>
      <div>
        <div>
          <div>
            </div></div></div></div>
github apache / apisix-dashboard / web / src / pages / Upstream / Create.tsx View on Github external
(id ? update(id, data) : create(data)).then(() => {
        notification.success({
          message: `${id
            ? formatMessage({ id: 'page.upstream.edit.upstream.successfully' })
            : formatMessage({ id: 'page.upstream.create.upstream.successfully' })
            }`,
        });
        history.replace('/upstream/list');
      });
    });
github apache / apisix-dashboard / web / src / pages / User / Login.tsx View on Github external
onClose: () => {
                const redirect = getUrlQuery('redirect');
                history.replace(redirect ? decodeURIComponent(redirect) : '/');
              },
            });
github apache / apisix-dashboard / web / src / pages / Service / List.tsx View on Github external
const savePageList = (page = 1, pageSize = 10) => {
    history.replace(`/service/list?page=${page}&pageSize=${pageSize}`);
  };
github apache / apisix-dashboard / src / pages / RouteGroup / Create.tsx View on Github external
(gid ? update(gid, data) : create(data)).then(() => {
      notification.success({
        message: `${
          gid
            ? formatMessage({ id: 'component.global.edit' })
            : formatMessage({ id: 'component.global.create' })
        }${formatMessage({ id: 'menu.routegroup' })}${formatMessage({
          id: 'component.status.success',
        })}`,
      });
      history.replace('/routegroup/list');
    });
  };
github apache / apisix-dashboard / web / src / pages / Dashboard / Dashboard.tsx View on Github external
onClick={() => {
                history.replace({
                  pathname: '/settings',
                });
              }}
            >
github apache / apisix-dashboard / web / src / pages / SSL / List.tsx View on Github external
const savePageList = (page = 1, pageSize = 10) => {
    history.replace(`/ssl/list?page=${page}&pageSize=${pageSize}`);
  };
github apache / apisix-dashboard / web / src / pages / Plugin / List.tsx View on Github external
const savePageList = (page = 1, pageSize = 10) => {
    history.replace(`/plugin/list?page=${page}&pageSize=${pageSize}`);
  };
github apache / apisix-dashboard / web / src / components / RightContent / AvatarDropdown.tsx View on Github external
const settings = async () => {
  history.replace({
    pathname: '/settings',
    search: stringify({
      redirect: window.location.href,
    }),
  });
};
github apache / apisix-dashboard / web / src / pages / Consumer / List.tsx View on Github external
const savePageList = (page = 1, pageSize = 10) => {
    history.replace(`/consumer/list?page=${page}&pageSize=${pageSize}`);
  };