Skip to content

Commit

Permalink
perf: 优化路由重复提示的报错
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Mar 23, 2022
1 parent 6fba945 commit 2bd0771
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions resources/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ router.afterEach(() => {
Vue.prototype.goForward = function(location, isReplace) {
if (typeof location === 'string') location = {name: location};
if (isReplace === true) {
app.$router.replace(location).then(() => {});
app.$router.replace(location).then(() => {}).catch(() => {});
} else {
app.$router.push(location).then(() => {});
app.$router.push(location).then(() => {}).catch(() => {});
}
};

Expand All @@ -94,7 +94,7 @@ Vue.prototype.goBack = function (number) {
if ($A.runNum(history['::count']) > 2) {
app.$router.go(typeof number === 'number' ? number : -1);
} else {
app.$router.replace(typeof number === "object" ? number : {path: '/'}).then(() => {});
app.$router.replace(typeof number === "object" ? number : {path: '/'}).then(() => {}).catch(() => {});
}
};

Expand Down

0 comments on commit 2bd0771

Please sign in to comment.