| | |
| | | import emitter from '/@/utils/mitt'; |
| | | import { accessSessionKey, userNameKey } from '/@/utils/request'; |
| | | import { gotoRoute } from '/@/utils/route'; |
| | | import { Local } from '/@/utils/storage'; |
| | | import { Local, LoginInfo } from '/@/utils/storage'; |
| | | |
| | | const loginFormRef = ref<FormInstance>(null); |
| | | const isLoginStatus = ref(!!Local.get(accessSessionKey)); |
| | |
| | | user: state.loginForm.account, |
| | | pass: state.loginForm.pwd, |
| | | }); |
| | | Local.set(accessSessionKey, res.hswatersession); |
| | | Local.set(userNameKey, state.loginForm.account); |
| | | |
| | | LoginInfo.set(res.hswatersession,state.loginForm.account); |
| | | state.isShowLogin = false; |
| | | isLoginStatus.value = true; |
| | | window.location.reload(); |
| | |
| | | const logoutClick = () => { |
| | | state.isShowExitLogin = false; |
| | | isLoginStatus.value = false; |
| | | Local.remove(accessSessionKey); |
| | | LoginInfo.remove(); |
| | | }; |
| | | const toggleExitLoginBtnRef = ref<HTMLDivElement>(null); |
| | | |