forked from p96170835/amis
form提交后跳转之前清空缓存
This commit is contained in:
parent
07a2333b51
commit
3b89664ebd
|
@ -562,17 +562,16 @@ export default class Form extends React.Component<FormProps, object> {
|
|||
if (onFinished && onFinished(values, action) === false) {
|
||||
return values;
|
||||
}
|
||||
|
||||
|
||||
resetAfterSubmit && store.reset(onReset);
|
||||
clearPersistDataAfterSubmit && store.clearPersistData();
|
||||
|
||||
if (action.redirect || redirect) {
|
||||
env.updateLocation(filter(action.redirect || redirect, store.data));
|
||||
} else if (action.reload || reload) {
|
||||
this.reloadTarget(action.reload || reload, store.data);
|
||||
}
|
||||
|
||||
resetAfterSubmit && store.reset(onReset);
|
||||
|
||||
clearPersistDataAfterSubmit && store.clearPersistData();
|
||||
|
||||
return values;
|
||||
})
|
||||
.catch(reason => {
|
||||
|
|
|
@ -401,8 +401,10 @@ export const FormStore = ServiceStore
|
|||
|
||||
function getPersistData() {
|
||||
self.persistData = true;
|
||||
let data = localStorage.getItem(location.pathname + self.path) || '{}';
|
||||
self.updateData(JSON.parse(data));
|
||||
let data = localStorage.getItem(location.pathname + self.path);
|
||||
if (data) {
|
||||
self.updateData(JSON.parse(data));
|
||||
}
|
||||
}
|
||||
|
||||
function clearPersistData() {
|
||||
|
|
Loading…
Reference in New Issue