1
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user