数数:创建角色增加distinctId
This commit is contained in:
@@ -183,14 +183,14 @@ export function connectThinkingData(app: Application) {
|
||||
}
|
||||
}
|
||||
|
||||
export function reportTAEvent(roleId: string, eventName: string, properties: any, ip?: string) {
|
||||
export function reportTAEvent(roleId: string, eventName: string, properties: any, ip?: string, distinctId?: string) {
|
||||
let ta = pinus.app.get('ta');
|
||||
if(!ta) return
|
||||
let event = {
|
||||
// 账号 ID (可选)
|
||||
accountId: `${roleId}`,
|
||||
// 访客 ID (可选),账号 ID 和访客 ID 不可以都为空
|
||||
distinctId: "",
|
||||
distinctId: (distinctId && distinctId != 'weikaiqishushu')? `${distinctId}`:"",
|
||||
// 事件名称 (必填)
|
||||
event: eventName,
|
||||
// 事件时间 (可选) 如果不填,将以调用接口时的时间作为事件时间
|
||||
@@ -235,7 +235,7 @@ export function reportTAUserSet(type: TA_USERSET_TYPE, roleId: string, propertie
|
||||
|
||||
export async function reportCreateRoleEventToTa(role: RoleType, ip: string) {
|
||||
if(role.shushuMark) {
|
||||
reportTAEvent(role.roleId, TA_EVENT.CREATE_ROLE, null, ip);
|
||||
reportTAEvent(role.roleId, TA_EVENT.CREATE_ROLE, null, ip, role.shushuMark);
|
||||
await RoleModel.updateRoleInfo(role.roleId, { shushuMark: '' });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user