Merge branch 'main' of http://18.167.251.121:10003/aidlab/lanecarford_front
This commit is contained in:
@@ -170,9 +170,11 @@ const { isLoading } = toRefs(data);
|
||||
margin-top: 2.5rem;
|
||||
> .model{
|
||||
border: 2px solid #D9D9D9;
|
||||
height: 110rem;
|
||||
// height: 110rem;
|
||||
aspect-ratio: 2 / 3;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
width: 93%;
|
||||
margin: 0 auto;
|
||||
> img{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
@@ -60,8 +60,6 @@ const formData = reactive({
|
||||
password: ''
|
||||
})
|
||||
|
||||
// 移除表单错误状态管理,改用 toast 提示
|
||||
|
||||
// 加载状态
|
||||
const isLoading = ref(false)
|
||||
|
||||
@@ -79,19 +77,19 @@ const validatePassword = (password: string) => {
|
||||
const validateForm = () => {
|
||||
// 验证邮箱
|
||||
if (!formData.email) {
|
||||
showToast('place input your email')
|
||||
showToast('Please input your email')
|
||||
return false
|
||||
} else if (!validateEmail(formData.email)) {
|
||||
showToast('please input valid email')
|
||||
showToast('Please input valid email')
|
||||
return false
|
||||
}
|
||||
|
||||
// 验证密码
|
||||
if (!formData.password) {
|
||||
showToast('please input password')
|
||||
showToast('Please input password')
|
||||
return false
|
||||
} else if (!validatePassword(formData.password)) {
|
||||
showToast('please input correct password')
|
||||
showToast('Please input correct password')
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -111,14 +109,13 @@ const handleLogin = async () => {
|
||||
|
||||
isLoading.value = true
|
||||
|
||||
fetchRegisterOrLogin({ ...formData, operationType: 'LOGIN' }).then((response) => {
|
||||
console.log('登录成功', response)
|
||||
userInfoStore.setToken(response.token)
|
||||
userInfoStore.setUserInfo(response.user)
|
||||
showToast('login success')
|
||||
router.replace('/stylist/customer')
|
||||
fetchRegisterOrLogin({ ...formData, operationType: 'LOGIN' }).then((response) => {
|
||||
console.log('登录成功', response)
|
||||
userInfoStore.setToken(response.token)
|
||||
userInfoStore.setUserInfo(response.user)
|
||||
showToast('login success')
|
||||
router.replace('/stylist/customer')
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// 处理忘记密码
|
||||
@@ -131,13 +128,13 @@ const handleForgotPassword = () => {
|
||||
const handleGoogleLogin = async () => {
|
||||
try {
|
||||
isLoading.value = true
|
||||
showToast('Google登录功能开发中...')
|
||||
showToast('Google login is not available yet')
|
||||
|
||||
// 这里添加Google OAuth登录逻辑
|
||||
// const response = await googleLoginAPI()
|
||||
} catch (error) {
|
||||
console.error('Google登录失败:', error)
|
||||
showToast('Google登录失败,请重试')
|
||||
showToast('Google login failed, please try again')
|
||||
} finally {
|
||||
isLoading.value = false
|
||||
}
|
||||
|
||||
@@ -66,13 +66,6 @@ const formData = reactive({
|
||||
password: ''
|
||||
})
|
||||
|
||||
// 表单验证状态
|
||||
const formErrors = reactive<Record<string, string>>({
|
||||
name: '',
|
||||
email: '',
|
||||
password: ''
|
||||
})
|
||||
|
||||
// 加载状态
|
||||
const isLoading = ref(false)
|
||||
|
||||
@@ -146,13 +139,13 @@ const handleConfirm = async () => {
|
||||
const handleSignupByGoogle = async () => {
|
||||
try {
|
||||
isLoading.value = true
|
||||
showToast('Google登录功能开发中...')
|
||||
showToast('Google sign up is not available yet')
|
||||
|
||||
// 这里添加Google OAuth登录逻辑
|
||||
// const response = await googleLoginAPI()
|
||||
} catch (error) {
|
||||
console.error('Google登录失败:', error)
|
||||
showToast('Google登录失败,请重试')
|
||||
showToast(error?.message || 'Google sign up failed, please try again')
|
||||
} finally {
|
||||
isLoading.value = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user