feat(detection): 添加检测锁机制防止多用户同时操作
- 新增 detectionLock store 管理检测锁状态 - 实现检测锁相关的弹窗提示功能 - 添加 DETECTION_BUSY 错误码处理多人竞争逻辑 - 在 websocket 中集成检测锁超时处理 - 修改程序源控制接口以同步锁状态 - 更新项目标题和图标配置 - 添加 docs 目录到忽略列表
This commit is contained in:
15
frontend/src/api/detection/lock.ts
Normal file
15
frontend/src/api/detection/lock.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import http from '@/api'
|
||||
import type { DetectionLockHolder } from '@/stores/modules/detectionLock'
|
||||
|
||||
/**
|
||||
* 查询当前检测锁持有状态
|
||||
* - data 为 null → 锁空闲
|
||||
* - data 非 null → 锁被某账号持有
|
||||
*
|
||||
* 本接口只读,不抢锁、不会返回 DETECTION_BUSY
|
||||
*/
|
||||
export const getCurrentLock = () => {
|
||||
return http.get<DetectionLockHolder | null>('/detection/lock/current', undefined, {
|
||||
loading: false
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user