From cb8d6096461752e321dda968d39999f3c2f81183 Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期五, 10 一月 2025 15:37:03 +0800
Subject: [PATCH] isNewUser

---
 src/layout/component/login/Login.vue |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/layout/component/login/Login.vue b/src/layout/component/login/Login.vue
index 888c3ab..5af5bc6 100644
--- a/src/layout/component/login/Login.vue
+++ b/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();

--
Gitblit v1.9.3