This commit is contained in:
zc
2026-03-27 13:44:16 +08:00
parent ad1cd77a48
commit 63013bbd67
2 changed files with 53 additions and 6 deletions

View File

@@ -0,0 +1,23 @@
import http from '@/utils/http'
const BASE_URL = '/api/light'
/** @desc 连接灯光 */
export function connect() {
return http.post<any>(`${BASE_URL}/connect`)
}
/** @desc 断开灯光连接 */
export function disconnect() {
return http.post<any>(`${BASE_URL}/disconnect`)
}
/** @desc 设置灯光亮度 */
export function brightness(materialId: string) {
return http.post<any>(`${BASE_URL}/brightness`, { materialId: Number(materialId) })
}
/** @desc 检查灯光状态 */
export function status() {
return http.get<any>(`${BASE_URL}/status`)
}