Explorar o código

更新 TgClientService,修改 ImportContacts 中的 clientId 生成方式为当前时间戳,并限制 lastName 字段的长度为 64 个字符,以提升数据一致性和有效性。

wuyi hai 1 mes
pai
achega
da088c53ce
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/services/tgClient.service.ts

+ 2 - 2
src/services/tgClient.service.ts

@@ -118,10 +118,10 @@ export class TgClientService {
           new Api.contacts.ImportContacts({
             contacts: [
               new Api.InputPhoneContact({
-                clientId: bigInt(0),
+                clientId: bigInt(Date.now()),
                 phone: parsedTarget,
                 firstName: 'Temp',
-                lastName: ''
+                lastName: `${parsedTarget}`.slice(0, 64)
               })
             ]
           })