vuerouter4.1.4更新导致路由缓存页面刷新出现404错误

pull/584/head
zhenAri 2023-06-10 15:08:46 +08:00
parent dfdb2ec106
commit 3f3035fbb8
2 changed files with 4 additions and 3 deletions

View File

@ -60,7 +60,7 @@ export const useRedo = (_router?: Router) => {
params['_redirect_type'] = 'path';
params['path'] = fullPath;
}
push({ name: REDIRECT_NAME, params, query }).then(() => resolve(true));
push({ name: REDIRECT_NAME, state: { params }, query }).then(() => resolve(true));
});
}
return redo;

View File

@ -5,9 +5,10 @@
import { unref } from 'vue';
import { useRouter } from 'vue-router';
const { currentRoute, replace } = useRouter();
const { currentRoute, replace, options } = useRouter();
const { params, query } = unref(currentRoute);
const { query } = unref(currentRoute);
const { params } = options.history.state as Recordable;
const { path, _redirect_type = 'path' } = params;
Reflect.deleteProperty(params, '_redirect_type');