From 38c52a92652f8430b3cf31cb3c06bbfdc8d293d8 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期二, 15 八月 2023 16:31:59 +0800
Subject: [PATCH] 登录页面redirect重定向功能(I7DBUP)
---
src/views/login.vue | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/views/login.vue b/src/views/login.vue
index d60e73f..cadd789 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -25,7 +25,7 @@
<template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template>
</el-input>
</el-form-item>
- <el-form-item prop="code" v-if="captchaOnOff">
+ <el-form-item prop="code" v-if="captchaEnabled">
<el-input
v-model="loginForm.code"
size="large"
@@ -59,7 +59,7 @@
</el-form>
<!-- 搴曢儴 -->
<div class="el-login-footer">
- <span>Copyright 漏 2018-2022 ruoyi.vip All Rights Reserved.</span>
+ <span>Copyright 漏 2018-2023 ruoyi.vip All Rights Reserved.</span>
</div>
</div>
</template>
@@ -71,6 +71,7 @@
import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
+const route = useRoute();
const router = useRouter();
const { proxy } = getCurrentInstance();
@@ -91,10 +92,14 @@
const codeUrl = ref("");
const loading = ref(false);
// 楠岃瘉鐮佸紑鍏�
-const captchaOnOff = ref(true);
+const captchaEnabled = ref(true);
// 娉ㄥ唽寮�鍏�
const register = ref(false);
const redirect = ref(undefined);
+
+watch(route, (newRoute) => {
+ redirect.value = newRoute.query && newRoute.query.redirect;
+}, { immediate: true });
function handleLogin() {
proxy.$refs.loginRef.validate(valid => {
@@ -117,7 +122,7 @@
}).catch(() => {
loading.value = false;
// 閲嶆柊鑾峰彇楠岃瘉鐮�
- if (captchaOnOff.value) {
+ if (captchaEnabled.value) {
getCode();
}
});
@@ -127,8 +132,8 @@
function getCode() {
getCodeImg().then(res => {
- captchaOnOff.value = res.captchaOnOff === undefined ? true : res.captchaOnOff;
- if (captchaOnOff.value) {
+ captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled;
+ if (captchaEnabled.value) {
codeUrl.value = "data:image/gif;base64," + res.img;
loginForm.value.uuid = res.uuid;
}
--
Gitblit v1.9.3