'admin-21.05.08:修复粘贴复制的链接,登录后不跳转到对应的链接的问题'

This commit is contained in:
lyt 2021-05-08 11:36:07 +08:00
parent 7c673b9ae6
commit daaafac7f8
2 changed files with 5 additions and 3 deletions

View File

@ -1079,7 +1079,7 @@ router.beforeEach((to, from, next) => {
NProgress.done();
} else {
if (!token) {
next('/login');
next(`/login?redirect=${to.path}`);
clearSession();
resetRoute();
NProgress.done();

View File

@ -52,7 +52,7 @@
<script lang="ts">
import { toRefs, reactive, defineComponent, computed } from 'vue';
import { useRouter } from 'vue-router';
import { useRoute, useRouter } from 'vue-router';
import { ElMessage } from 'element-plus';
import { useI18n } from 'vue-i18n';
import { initAllFun, initBackEndControlRoutesFun } from '/@/router/index.ts';
@ -64,6 +64,7 @@ export default defineComponent({
setup() {
const { t } = useI18n();
const store = useStore();
const route = useRoute();
const router = useRouter();
const state = reactive({
ruleForm: {
@ -134,7 +135,8 @@ export default defineComponent({
let currentTimeInfo = currentTime.value;
//
// router No match found for location with path "/"
router.push('/');
// /
route.query?.redirect ? router.push(route.query.redirect) : router.push('/');
//
setTimeout(() => {
// loading