How to use the umi/router.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 umijs / umi-example-ssr-with-egg / app / web / pages / home / index.jsx View on Github external
constructor(props) {
    super(props);
    if (window.location && window.location.pathname.indexOf('/home') < 0) {
      router.replace('/home');
    }
  }
github umijs / umi-examples / eleme-demo / pages / home / page.jsx View on Github external
constructor(props) {
    super(props);
    if (window.location.pathname.indexOf('/home') < 0) {
      router.replace('/home');
      return;
    }
  }
github umijs / umi / examples / eleme-demo / pages / home / page.jsx View on Github external
constructor(props) {
    super(props);
    if (window.location.pathname.indexOf('/home') < 0) {
      router.replace('/home');
      return;
    }
  }
github remaxjs / remax / packages / remax / src / adapters / h5 / api / navigation / redirectTo.ts View on Github external
return new Promise(resolve => {
    router.replace(params.url);
    if (params.success) {
      params.success();
    } else {
      resolve();
    }
    if (params.complete) {
      params.complete();
    }
  });
};
github eggjs / examples / assets-with-umi / app / web / pages / home / index.jsx View on Github external
constructor(props) {
    super(props);
    if (window.location.pathname.indexOf('/home') < 0) {
      router.replace('/home');
      return;
    }
  }
github umijs / umi-server / examples / eggjs / app / web / pages / home / index.jsx View on Github external
constructor(props) {
    super(props);
    if (window.location && window.location.pathname.indexOf('/home') < 0) {
      router.replace('/home');
    }
  }
github layupbolon / cnode-with-umi / src / pages / index.js View on Github external
componentDidMount() {
        router.replace('/topicList');
    }
    render() {
github layupbolon / cnode-with-umi / src / pages / login / index.js View on Github external
cb: (isSuccess, msg) => {
                                    if (isSuccess) {
                                        Toast.success(msg, 1);
                                        router.replace('/me');
                                    } else {
                                        Toast.fail(msg, 1);
                                    }
                                }
                            }
github ZhiXiao-Lin / nestify / admin / src / models / user.js View on Github external
*logout(_, { call, put }) {
      localStorage.removeItem('token');
      sessionStorage.removeItem('currentUser');

      yield put({
        type: 'set',
        payload: {
          currentUser: null,
        },
      });

      router.replace('/user/login');
    },
    *fetchCurrentUser({ payload }, { call, put, select }) {