wujingjing
2025-01-10 cb8d6096461752e321dda968d39999f3c2f81183
src/layout/component/login/Login.vue
@@ -103,11 +103,12 @@
});
//登录
const onSubmit = async () => {
   let res;
   if (state.activeLoginName === 'accountUser') {
      //账户密码登录
      const isValid = await loginFormRef.value.validate().catch(() => {});
      if (!isValid) return;
      const res = await PostLogin({
      res = await PostLogin({
         user: state.loginForm.account,
         pass: state.loginForm.pwd,
         client: LOGIN_CLIENT,
@@ -115,7 +116,6 @@
      if (!res.json_ok) {
         return ElMessage.error(res.json_msg);
      }
      userInfo.set(res);
      Local.set(userInfoKey, {
         id: res.id,
         realName: res.real_name,
@@ -131,7 +131,7 @@
      //手机登录
      const isValid = await formPhoneRef.value.validate().catch(() => {});
      if (!isValid) return;
      const res = await loginMessageUser({
      res = await loginMessageUser({
         phone: state.loginPhoneForm.phoneUser,
         code: state.loginPhoneForm.verifyCode,
         client: LOGIN_CLIENT,
@@ -150,8 +150,8 @@
         email: res.email,
      } as any);
      LoginInfo.set(res.hswatersession, state.loginPhoneForm.phoneUser);
      userInfo.set(res);
   }
   Local.set('isNewUser', !res?.web_login);
   isShowLogin.value = false;
   isLoginStatus.value = true;
   window.location.reload();