统一登录成功后进入智能对话页面
This commit is contained in:
parent
c502bc17c4
commit
71437dfa25
@ -7,24 +7,20 @@ import {
|
|||||||
Smartphone,
|
Smartphone,
|
||||||
} from "@lucide/vue";
|
} from "@lucide/vue";
|
||||||
import { computed, ref } from "vue";
|
import { computed, ref } from "vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
import { useAuthStore } from "@/stores/auth.store";
|
import { useAuthStore } from "@/stores/auth.store";
|
||||||
|
|
||||||
const auth = useAuthStore();
|
const auth = useAuthStore();
|
||||||
const route = useRoute();
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const mode = ref<"password" | "dingtalk">("password");
|
const mode = ref<"password" | "dingtalk">("password");
|
||||||
const useDevelopmentLogin = ref(true);
|
const useDevelopmentLogin = ref(true);
|
||||||
const username = ref("local-admin");
|
const username = ref("local-admin");
|
||||||
const password = ref("risk-admin-2026");
|
const password = ref("risk-admin-2026");
|
||||||
|
|
||||||
const redirectPath = computed(() => {
|
// 登录后的统一落点是智能对话页,避免从其他受保护页面跳转到登录后
|
||||||
const redirect = route.query.redirect;
|
// 又回到原页面,保证用户进入系统后先看到对话工作台。
|
||||||
return typeof redirect === "string" && redirect.startsWith("/")
|
const redirectPath = computed(() => "/assessment");
|
||||||
? redirect
|
|
||||||
: "/assessment";
|
|
||||||
});
|
|
||||||
|
|
||||||
async function submitPassword() {
|
async function submitPassword() {
|
||||||
if (!username.value.trim() || password.value.length < 8 || auth.loading)
|
if (!username.value.trim() || password.value.length < 8 || auth.loading)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user