feat: api创建

This commit is contained in:
zhangyh
2025-10-24 17:37:15 +08:00
parent 21384516ce
commit 5fe30c82c8
14 changed files with 197 additions and 86 deletions

View File

@@ -48,6 +48,7 @@ import { ref, reactive, computed } from 'vue'
import { useRouter } from 'vue-router'
import { showToast } from 'vant'
import { google } from '@/assets/base64'
import { fetchLogin } from '@/api/login'
const router = useRouter()
@@ -108,23 +109,19 @@ const handleLogin = async () => {
isLoading.value = true
try {
// 模拟登录API调用
await new Promise((resolve) => setTimeout(resolve, 2000))
// 这里添加实际的登录API调用
// const response = await loginAPI(formData)
showToast('登录成功')
// 登录成功后跳转到主页或工作台
router.push('/stylist/customer')
} catch (error) {
console.error('登录失败:', error)
showToast('登录失败,请重试')
} finally {
isLoading.value = false
const response: any = await fetchLogin({ ...formData, operationType: 'LOGIN' } as any)
if (response.code === 200) {
console.log('登录成功', response)
// showToast('登录成功')
// router.push('/stylist/customer')
} else {
showToast(response.message)
}
// showToast('登录成功')
// 登录成功后跳转到主页或工作台
// router.push('/stylist/customer')
}
// 处理忘记密码