Skip to content

Commit 1235978

Browse files
committed
fix: useRedo called duplicate may cause exception
修复useRedo的不当调用可能导致异常的问题 fixed: #1121
1 parent 9dd9fcd commit 1235978

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.zh_CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- 修复部分封装组件在使用插槽时报错的问题
1515
- 修复`useECharts``theme`参数不起作用的问题
1616
- 修复`Token`失效时,按 F5 刷新页面可能会出现页面加载异常的问题
17+
- 修复`useRedo`的不当调用可能会导致重定向`path`异常的问题
1718

1819
## 2.7.1(2021-08-16)
1920

src/hooks/web/usePage.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ export const useRedo = (_router?: Router) => {
4242
const { query, params = {}, name, fullPath } = unref(currentRoute.value);
4343
function redo(): Promise<boolean> {
4444
return new Promise((resolve) => {
45+
if (name === REDIRECT_NAME) {
46+
resolve(false);
47+
return;
48+
}
4549
if (name && Object.keys(params).length > 0) {
4650
params['_redirect_type'] = 'name';
4751
params['path'] = String(name);

0 commit comments

Comments
 (0)