登录处理
This commit is contained in:
@@ -25,10 +25,14 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Laptop, Smartphone, Tablet, Monitor, Cpu, HelpCircle, X } from 'lucide-vue-next'
|
||||
import request from '@/utils/request'
|
||||
import { toast } from 'vue-sonner'
|
||||
|
||||
interface Device {
|
||||
id: string
|
||||
name: string
|
||||
user_agent: string
|
||||
identifier: string
|
||||
type: 'mobile' | 'desktop'
|
||||
deviceId: string
|
||||
}
|
||||
@@ -37,13 +41,20 @@ defineProps<{
|
||||
devices: Device[]
|
||||
}>()
|
||||
|
||||
function delDevice(item) {
|
||||
console.log('Device removed', item)
|
||||
const emit = defineEmits(['refresh'])
|
||||
|
||||
function delDevice(device: Device) {
|
||||
if (confirm('请确认是否移除此设备?')) {
|
||||
request.put('/api/v1/public/user/unbind_device', { id: device.id }).then(() => {
|
||||
toast.success('设备已移除')
|
||||
emit('refresh')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
interface DeviceTypeInfo {
|
||||
type: string
|
||||
icon: string
|
||||
iconComponent: any
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user