Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(props) {
super(props);
if (window.location && window.location.pathname.indexOf('/home') < 0) {
router.replace('/home');
}
}
constructor(props) {
super(props);
if (window.location.pathname.indexOf('/home') < 0) {
router.replace('/home');
return;
}
}
constructor(props) {
super(props);
if (window.location.pathname.indexOf('/home') < 0) {
router.replace('/home');
return;
}
}
return new Promise(resolve => {
router.replace(params.url);
if (params.success) {
params.success();
} else {
resolve();
}
if (params.complete) {
params.complete();
}
});
};
constructor(props) {
super(props);
if (window.location.pathname.indexOf('/home') < 0) {
router.replace('/home');
return;
}
}
cb: () => {
router.replace('/topicList');
}
}
constructor(props) {
super(props);
if (window.location && window.location.pathname.indexOf('/home') < 0) {
router.replace('/home');
}
}
componentDidMount() {
router.replace('/topicList');
}
render() {
cb: (isSuccess, msg) => {
if (isSuccess) {
Toast.success(msg, 1);
router.replace('/me');
} else {
Toast.fail(msg, 1);
}
}
}
*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 }) {