This commit is contained in:
Esacpe 2025-05-21 10:39:48 +08:00
parent 2f9762a1fa
commit 34a2984a00

View File

@ -109,25 +109,24 @@ const loading = ref(false);
const loginFromRef = ref(null); const loginFromRef = ref(null);
const router = useRouter(); const router = useRouter();
const handleLogin = () => { const handleLogin = () => {
window.location.href = '/' loginFromRef.value.validate((valid) => {
// loginFromRef.value.validate((valid) => { if (!valid) return false;
// if (!valid) return false; loading.value = true;
// loading.value = true; store.dispatch("user/login", loginForm.value).then((res) => {
// store.dispatch("user/login", loginForm.value).then((res) => { loading.value = false;
// loading.value = false; //
// // if (res.deptList.length === 1) {
// if (res.deptList.length === 1) { window.location.href = '/'
// window.location.href = '/' } else {
// } else { deptList.value = [...res.deptList];
// deptList.value = [...res.deptList]; loginDialog.value = true;
// loginDialog.value = true; authorization.value = res.jwtToken;
// authorization.value = res.jwtToken; ElNotification({title: "提示",message: "请选择部门",duration: 3000});
// ElNotification({title: "",message: "",duration: 3000}); }
// } }).catch(() => {
// }).catch(() => { loading.value = false;
// loading.value = false; });
// }); });
// });
}; };
const logout = () => { const logout = () => {
store.dispatch("user/logout"); store.dispatch("user/logout");