feat(ops): 设备与绑定接口接入运维模式路径区分

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
17792275749
2026-08-25 19:05:58 +08:00
co-authored by Claude Opus 4.7
parent 431be11ecd
commit 2afe598881
2 changed files with 23 additions and 7 deletions
@@ -4,9 +4,15 @@ import type { RawDevice } from '../../lefu/types'
import { post } from '../../utils/request/index'
import type { UserInfo } from '../../api/index'
/** 绑定设备 SN 到用户信息 */
/** 绑定设备 SN 到用户信息(运维模式走 ops/addDevice,普通模式走 v6/bindDevice */
const bindDevice = (data: { sn: string; idCard: string; connectDeviceInfo?: string }) =>
post('weighingScale/v6/bindDevice', data, { loading: false })
post(
getApp<IAppOption>().globalData.operationsEngineer
? 'weighingScale/ops/addDevice'
: 'weighingScale/v6/bindDevice',
data,
{ loading: false },
)
/** 渲染用的设备项(RawDevice 含复杂对象,不进 setData */
interface DeviceItem {