add:新增同一个工单同一人可以多次拼单
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
/** 客户端幂等键:一次用户点击一个,用于拼单参与/抢单的服务端去重。 */
|
||||
export function createRequestId(prefix = 'req'): string {
|
||||
const random =
|
||||
typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function'
|
||||
? crypto.randomUUID()
|
||||
: `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`
|
||||
return `${prefix}-${random}`
|
||||
}
|
||||
Reference in New Issue
Block a user