This commit is contained in:
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 = () => {
loginFromRef.value.validate((valid) => {
if (!valid) return false;
loading.value = true;
store.dispatch("user/login", loginForm.value).then((res) => {
loading.value = false;
// 登录后操作
if (res.deptList.length === 1) {
window.location.href = '/' window.location.href = '/'
// loginFromRef.value.validate((valid) => { } else {
// if (!valid) return false; deptList.value = [...res.deptList];
// loading.value = true; loginDialog.value = true;
// store.dispatch("user/login", loginForm.value).then((res) => { authorization.value = res.jwtToken;
// loading.value = false; ElNotification({title: "提示",message: "请选择部门",duration: 3000});
// // 登录后操作 }
// if (res.deptList.length === 1) { }).catch(() => {
// window.location.href = '/' loading.value = false;
// } else { });
// deptList.value = [...res.deptList]; });
// loginDialog.value = true;
// authorization.value = res.jwtToken;
// ElNotification({title: "提示",message: "请选择部门",duration: 3000});
// }
// }).catch(() => {
// loading.value = false;
// });
// });
}; };
const logout = () => { const logout = () => {
store.dispatch("user/logout"); store.dispatch("user/logout");