2
0

feat: 测试上网功能

This commit is contained in:
TsMask
2024-12-13 21:07:55 +08:00
parent 7cf6249fd8
commit edfec45390

View File

@@ -1,10 +1,11 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue' import {ref} from 'vue'
import type { TableColumnsType } from 'ant-design-vue' import type {TableColumnsType} from 'ant-design-vue'
import { WifiOutlined } from '@ant-design/icons-vue' import {WifiOutlined} from '@ant-design/icons-vue'
import {useI18n} from "vue-i18n"; import {useI18n} from "vue-i18n";
import {clientAuth, clientInfo, clientUnAuth} from '@/service/ue/client';
const {t} = useI18n(); const {t} = useI18n();
interface DeviceInfo { interface DeviceInfo {
key: string key: string
@@ -50,6 +51,28 @@ const deviceList = ref<DeviceInfo[]>([
speed: '8.1 Mbps' speed: '8.1 Mbps'
} }
]) ])
/**
* 模拟测试上网
* @param type
*/
function clickBtn(type: string) {
if (type === "auth") {
clientAuth().then((res) => {
alert(JSON.stringify(res))
})
}
if (type === "unauth") {
clientUnAuth().then((res) => {
alert(JSON.stringify(res))
})
}
if (type === "info") {
clientInfo().then((res) => {
alert(JSON.stringify(res))
})
}
}
</script> </script>
<template> <template>
@@ -57,7 +80,7 @@ const deviceList = ref<DeviceInfo[]>([
<a-card :bordered="false"> <a-card :bordered="false">
<template #title> <template #title>
<div class="card-title"> <div class="card-title">
<WifiOutlined /> <WifiOutlined/>
<span>{{ t('page.access.currentdevice') }}</span> <span>{{ t('page.access.currentdevice') }}</span>
</div> </div>
</template> </template>
@@ -83,6 +106,13 @@ const deviceList = ref<DeviceInfo[]>([
> >
</a-table> </a-table>
</a-card> </a-card>
<!-- 终端测试上网 -->
<a-space wrap>
<a-button type="primary" @click="clickBtn('auth')">终端上网</a-button>
<a-button @click="clickBtn('unauth')">终端下线</a-button>
<a-button type="dashed" @click="clickBtn('info')">终端信息</a-button>
</a-space>
</div> </div>
</template> </template>