fix: `useRedo` called duplicate may cause exception
修复useRedo的不当调用可能导致异常的问题 fixed: #1121
This commit is contained in:
parent
9dd9fcd334
commit
1235978ab2
|
|
@ -14,6 +14,7 @@
|
||||||
- 修复部分封装组件在使用插槽时报错的问题
|
- 修复部分封装组件在使用插槽时报错的问题
|
||||||
- 修复`useECharts`的`theme`参数不起作用的问题
|
- 修复`useECharts`的`theme`参数不起作用的问题
|
||||||
- 修复`Token`失效时,按 F5 刷新页面可能会出现页面加载异常的问题
|
- 修复`Token`失效时,按 F5 刷新页面可能会出现页面加载异常的问题
|
||||||
|
- 修复`useRedo`的不当调用可能会导致重定向`path`异常的问题
|
||||||
|
|
||||||
## 2.7.1(2021-08-16)
|
## 2.7.1(2021-08-16)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,10 @@ export const useRedo = (_router?: Router) => {
|
||||||
const { query, params = {}, name, fullPath } = unref(currentRoute.value);
|
const { query, params = {}, name, fullPath } = unref(currentRoute.value);
|
||||||
function redo(): Promise<boolean> {
|
function redo(): Promise<boolean> {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
|
if (name === REDIRECT_NAME) {
|
||||||
|
resolve(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (name && Object.keys(params).length > 0) {
|
if (name && Object.keys(params).length > 0) {
|
||||||
params['_redirect_type'] = 'name';
|
params['_redirect_type'] = 'name';
|
||||||
params['path'] = String(name);
|
params['path'] = String(name);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue