提交 1235978a 编写于 作者: 无木

fix: `useRedo` called duplicate may cause exception

修复useRedo的不当调用可能导致异常的问题

fixed: #1121
上级 9dd9fcd3
......@@ -14,6 +14,7 @@
- 修复部分封装组件在使用插槽时报错的问题
- 修复`useECharts``theme`参数不起作用的问题
- 修复`Token`失效时,按 F5 刷新页面可能会出现页面加载异常的问题
- 修复`useRedo`的不当调用可能会导致重定向`path`异常的问题
## 2.7.1(2021-08-16)
......
......@@ -42,6 +42,10 @@ export const useRedo = (_router?: Router) => {
const { query, params = {}, name, fullPath } = unref(currentRoute.value);
function redo(): Promise<boolean> {
return new Promise((resolve) => {
if (name === REDIRECT_NAME) {
resolve(false);
return;
}
if (name && Object.keys(params).length > 0) {
params['_redirect_type'] = 'name';
params['path'] = String(name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册