feat: 新增设备切卡模式
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 3m57s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 3m57s
This commit is contained in:
@@ -233,4 +233,19 @@ export class DeviceService extends BaseService {
|
||||
data
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置切卡模式
|
||||
* @param identifier 设备标识(虚拟号 / IMEI / SN)
|
||||
* @param switchMode 切卡模式(0=自动切卡,1=手动切卡)
|
||||
*/
|
||||
static setSwitchMode(
|
||||
identifier: string,
|
||||
switchMode: number
|
||||
): Promise<BaseResponse<DeviceOperationResponse>> {
|
||||
return this.post<BaseResponse<DeviceOperationResponse>>(
|
||||
`/api/admin/devices/by-identifier/${identifier}/switch-mode`,
|
||||
{ switch_mode: switchMode }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ export { PollingConcurrencyService } from './pollingConcurrency'
|
||||
export { PollingConfigService } from './pollingConfig'
|
||||
export { ManualTriggerService } from './manualTrigger'
|
||||
export { PollingMonitorService } from './pollingMonitor'
|
||||
export { SuperAdminService } from './superAdmin'
|
||||
|
||||
// TODO: 按需添加其他业务模块
|
||||
// export { SettingService } from './setting'
|
||||
|
||||
36
src/api/modules/superAdmin.ts
Normal file
36
src/api/modules/superAdmin.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* 超级管理员操作密码 API
|
||||
*/
|
||||
|
||||
import { BaseService } from '../BaseService'
|
||||
import type { BaseResponse } from '@/types/api'
|
||||
|
||||
interface OperationPasswordStatusResponse {
|
||||
is_set: boolean
|
||||
}
|
||||
|
||||
interface SetOperationPasswordParams {
|
||||
password: string
|
||||
confirm_password: string
|
||||
}
|
||||
|
||||
export class SuperAdminService extends BaseService {
|
||||
/**
|
||||
* 查询操作密码是否已设置
|
||||
* GET /api/admin/super-admin/operation-password/status
|
||||
*/
|
||||
static getOperationPasswordStatus(): Promise<BaseResponse<OperationPasswordStatusResponse>> {
|
||||
return this.get<BaseResponse<OperationPasswordStatusResponse>>(
|
||||
'/api/admin/super-admin/operation-password/status'
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置/重置操作密码
|
||||
* POST /api/admin/super-admin/operation-password
|
||||
* @param params 包含 password 和 confirm_password
|
||||
*/
|
||||
static setOperationPassword(params: SetOperationPasswordParams): Promise<BaseResponse> {
|
||||
return this.post<BaseResponse>('/api/admin/super-admin/operation-password', params)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user