redirect 调整

This commit is contained in:
2betop 2020-05-27 17:35:12 +08:00
parent fc61c5ffcd
commit 1a68f8b560
3 changed files with 10 additions and 10 deletions

View File

@ -334,9 +334,8 @@ export default class CRUD extends React.Component<CRUDProps, any> {
const data = ctx;
// 由于 ajax 一段时间后再弹出,肯定被浏览器给阻止掉的,所以提前弹。
action.redirect &&
action.blank &&
env.jumpTo(filter(action.redirect, data), action);
const redirect = action.redirect && filter(action.redirect, data);
redirect && action.blank && env.jumpTo(redirect, action);
return store
.saveRemote(action.api!, data, {
@ -355,9 +354,8 @@ export default class CRUD extends React.Component<CRUDProps, any> {
stopAutoRefreshWhenModalIsOpen && clearTimeout(this.timer);
}
action.redirect &&
!action.blank &&
env.jumpTo(filter(action.redirect, data), action);
const redirect = action.redirect && filter(action.redirect, data);
redirect && !action.blank && env.jumpTo(redirect, action);
action.reload
? this.reloadTarget(action.reload, data)
: this.search(undefined, undefined, true);

View File

@ -678,8 +678,9 @@ export class DialogRenderer extends Dialog {
await this.openFeedback(action.feedback, store.data);
}
action.redirect &&
env.jumpTo(filter(action.redirect, store.data), action);
const reidrect =
action.redirect && filter(action.redirect, store.data);
reidrect && env.jumpTo(reidrect, action);
action.reload && this.reloadTarget(action.reload, store.data);
action.close && this.handleSelfClose();
})

View File

@ -675,8 +675,9 @@ export class DrawerRenderer extends Drawer {
await this.openFeedback(action.feedback, store.data);
}
action.redirect &&
env.jumpTo(filter(action.redirect, store.data), action);
const redirect =
action.redirect && filter(action.redirect, store.data);
redirect && env.jumpTo(redirect, action);
action.reload && this.reloadTarget(action.reload, store.data);
action.close && this.handleSelfClose();
})