@@ -220,7 +220,12 @@ router.beforeEach(async (to, from, next) => {
NProgress.done();
} else {
if (!token) {
- next(`/login?redirect=${to.path}¶ms=${JSON.stringify(to.query ? to.query : to.params)}`);
+ const params = Object.keys(to.query).length || Object.keys(to.params).length
+ let paramsStr = ''
+ if (params) {
+ paramsStr = `¶ms=${JSON.stringify(Object.keys(to.query).length ? to.query : to.params)}`
+ }
+ next(`/login?redirect=${to.path}${paramsStr}`);
Session.clear();
resetRoute();
@@ -160,7 +160,7 @@ export default defineComponent({
if (route.query?.redirect) {
router.push({
path: route.query?.redirect as string,
- query: Object.keys(route.query?.params as string).length > 0 ? JSON.parse(route.query?.params as string) : '',
+ query: route.query.params ? (Object.keys(route.query?.params as string).length > 0 ? JSON.parse(route.query?.params as string) : '') : '',
});
router.push('/');