feat:蓝牙绑定和在线客服

This commit is contained in:
李伊帆
2026-10-13 16:23:43 +08:00
parent d4b02745e1
commit e22ebd6bef
128 changed files with 10429 additions and 385 deletions

20
src/utils/device-id.ts Normal file
View File

@@ -0,0 +1,20 @@
/** 从路由参数等解析 ID,避免 Number() 导致 int64 精度丢失 */
export function parseId(raw: unknown): string {
if (raw === undefined || raw === null || raw === '') return ''
const id = String(raw).trim()
return id === '0' ? '' : id
}
/** 从路由参数等解析设备 ID */
export function parseDeviceId(raw: unknown): string {
return parseId(raw)
}
export function isValidDeviceId(id: string): boolean {
return /^\d+$/.test(id)
}
export function sameId(a: unknown, b: unknown): boolean {
if (a == null || b == null || a === '' || b === '') return false
return String(a) === String(b)
}