test: 测试连通上网
This commit is contained in:
31
src/service/ue/client.ts
Normal file
31
src/service/ue/client.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { request } from '../request';
|
||||
|
||||
/**
|
||||
* 对给定的客户端进行身份验证
|
||||
*/
|
||||
export function clientAuth() {
|
||||
return request<any>({
|
||||
url: '/u/client/auth',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 对给定的客户端进行身份验证
|
||||
*/
|
||||
export function clientUnAuth() {
|
||||
return request<any>({
|
||||
url: '/u/client/unauth',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取客户信息
|
||||
*/
|
||||
export function clientInfo() {
|
||||
return request<any>({
|
||||
url: '/u/client/info',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { useAuthStore } from '@/store/modules/auth';
|
||||
import {clientUnAuth,clientAuth, clientInfo} from '@/service/ue/client';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { computed } from 'vue';
|
||||
import { ref, computed } from 'vue';
|
||||
import { UserOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
const router = useRouter();
|
||||
@@ -28,10 +29,47 @@ const menuItems = [
|
||||
icon: 'i-carbon:devices',
|
||||
title: '设备管理',
|
||||
path: '/user/devices'
|
||||
},
|
||||
{
|
||||
icon: 'i-carbon:devices',
|
||||
title: '终端上网',
|
||||
path: 'auth'
|
||||
},
|
||||
{
|
||||
icon: 'i-carbon:devices',
|
||||
title: '终端下线',
|
||||
path: 'unauth'
|
||||
},
|
||||
{
|
||||
icon: 'i-carbon:devices',
|
||||
title: '终端信息',
|
||||
path: 'info'
|
||||
}
|
||||
];
|
||||
|
||||
const infoC = ref({})
|
||||
const handleMenuClick = (path: string) => {
|
||||
if(path==="auth"){
|
||||
clientAuth().then((res)=>{
|
||||
console.log(res)
|
||||
infoC.value = res.data
|
||||
})
|
||||
return
|
||||
}
|
||||
if(path==="unauth"){
|
||||
clientUnAuth().then((res)=>{
|
||||
console.log(res)
|
||||
infoC.value = res.data
|
||||
})
|
||||
return
|
||||
}
|
||||
if(path==="info"){
|
||||
clientInfo().then((res)=>{
|
||||
console.log(res)
|
||||
infoC.value = res.data
|
||||
})
|
||||
return
|
||||
}
|
||||
router.push(path);
|
||||
};
|
||||
</script>
|
||||
@@ -76,6 +114,7 @@ const handleMenuClick = (path: string) => {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{infoC || '无信息'}}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user