feat:结束服务接口调用
This commit is contained in:
19
src/App.vue
19
src/App.vue
@@ -4,7 +4,7 @@ import Input from "primevue/inputtext";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { WebSocketClient } from "./utils/websocket";
|
||||
import { logger } from "./utils/logger/Logger";
|
||||
import { lockDoorApi, openDoorApi } from "@/api/api";
|
||||
import { lockDoorApi, openDoorApi, exitServerApi } from "@/api/api";
|
||||
// import {useAppStore} from "@/store/__APP__store"
|
||||
// const appStore = useAppStore()
|
||||
const token = ref("");
|
||||
@@ -82,6 +82,10 @@ const openDoor = async (port: number) => {
|
||||
const lockDoor = async (type: number, sid: number) => {
|
||||
await lockDoorApi(type, sid, token.value);
|
||||
};
|
||||
const exitServer = async (clienId: number, storeId: number) => {
|
||||
await exitServerApi(clienId, storeId, token.value);
|
||||
// token.value = ""
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -188,6 +192,19 @@ const lockDoor = async (type: number, sid: number) => {
|
||||
</div>
|
||||
</div>
|
||||
</Button>
|
||||
<Button
|
||||
@click="exitServer(1, 1)"
|
||||
pt:root="bg-[rgba(36,87,232,1)] active:bg-[rgba(36,87,232,0.6)] cursor-pointer py-2 px-4 rounded-full border-0 flex justify-center"
|
||||
>
|
||||
<div class="flex gap-1 items-center">
|
||||
<div class="h-24px w-24px">
|
||||
<img src="@/assets/images/icon_sy@2x.png" alt="" />
|
||||
</div>
|
||||
<div class="text-white font-bold text-md flex items-center">
|
||||
<span>结束服务</span>
|
||||
</div>
|
||||
</div>
|
||||
</Button>
|
||||
</div>
|
||||
<div class="flex flex-1 justify-end">
|
||||
<Input
|
||||
|
@@ -38,3 +38,18 @@ export const lockDoorApi = async (type: number, sid: number, token: string) => {
|
||||
}
|
||||
);
|
||||
};
|
||||
export const exitServerApi = async (
|
||||
client_id: number,
|
||||
store_id: number,
|
||||
token
|
||||
) => {
|
||||
return request.post(
|
||||
"/pc/v1/end/service",
|
||||
{ client_id, store_id },
|
||||
{
|
||||
headers: {
|
||||
Authorization: "Bearer " + token,
|
||||
},
|
||||
}
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user