export function guuid(userId = '') {
    const uid =  'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
        const r = Math.random() * 16 | 0,
            v = c == 'x' ? r : (r & 0x3 | 0x8);
        return v.toString(16)
    });
    return userId ? `${userId}` + '-'  + `${uid}` : uid;
}


export function generateId() {
  // 获取当前时间戳(13位)
  const timestamp = Date.now();
  
  // 生成7位随机数
  const randomPart = Math.floor(Math.random() * 9000000) + 1000000;
  
  // 组合成20位ID
  return `66${timestamp}${randomPart}`.substr(0, 18);
}
