This commit is contained in:
2025-09-27 17:41:43 +08:00
parent fe3e24b945
commit 96b396500e
10 changed files with 76 additions and 84 deletions

View File

@@ -3,6 +3,7 @@ import { ref, computed } from 'vue'
import { ElMessage } from 'element-plus'
import { User } from '@element-plus/icons-vue'
import { authApi } from '../../api/auth'
import { deviceApi } from '../../api/device'
interface Props {
modelValue: boolean
@@ -30,6 +31,10 @@ async function handleAuth() {
authLoading.value = true
try {
// 1. 先检查设备限制
await deviceApi.register({ username: authForm.value.username })
// 2. 设备检查通过,进行登录
const data = await authApi.login(authForm.value)
emit('loginSuccess', {
token: data.token,