fix: 登录后重定向页面
This commit is contained in:
@@ -14,10 +14,6 @@ const appStore = useAppStore();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
/**登录后重定向页面 */
|
||||
const redirectPath =
|
||||
(route.query && (route.query.redirect as string)) || '/index';
|
||||
|
||||
let state = reactive({
|
||||
/**表单属性 */
|
||||
from: {
|
||||
@@ -52,7 +48,9 @@ function fnFinish() {
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success(t('views.login.loginSuccess'), 3);
|
||||
router.push({ path: redirectPath });
|
||||
/**登录后重定向页面 */
|
||||
const redirectPath = route.query?.redirect || '/index';
|
||||
router.push({ path: redirectPath as string });
|
||||
} else {
|
||||
message.error(`${res.msg}`, 3);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user