We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0eb2a7b commit a34f33cCopy full SHA for a34f33c
src/router/index.ts
@@ -219,4 +219,15 @@ router.afterEach((_to, _from) => {
219
NProgress.done()
220
})
221
222
+// 添加异常处理
223
+const originalPush = router.push
224
+router.push = (to) => {
225
+ try {
226
+ return originalPush(to)
227
+ } catch (error) {
228
+ console.log(`%c${ error }`, 'color:red')
229
+ return originalPush({ name: '401' })
230
+ }
231
+}
232
+
233
export default router
src/store/modules/tab/index.ts
@@ -72,6 +72,8 @@ export default {
72
let val = `${ route.name as string }-${ meta.id }`
73
if (meta.multiple) {
74
val += `-${ queryStr }-${ paramsStr }`
75
+ } else {
76
+ val += `-{}-{}`
77
}
78
const tab: Tab = {
79
value: val,
0 commit comments