sdk:修复登录接口
This commit is contained in:
@@ -609,7 +609,7 @@ export class RoleHandler {
|
||||
let role = await RoleModel.findByRoleId(roleId);
|
||||
let user = await UserModel.findUserByUid(role.userInfo.uid);
|
||||
|
||||
reportTAEvent(roleId, 'test', user.ip);
|
||||
reportTAEvent(user.userCode, role.serverId, 'test', user.ip);
|
||||
|
||||
return resResult(STATUS.SUCCESS);
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ export async function checkGuildName(guildCode: string, serverId: number, name:
|
||||
let body = new CheckGuild37Params(guildCode, serverId, 1, name);
|
||||
nameResult = await request37Post(SDK_37_ADDR.CHECK_UNION, body, SDK_37_CONST.CHAT_KEY);
|
||||
}
|
||||
if(notice != undefined) {
|
||||
if(notice) {
|
||||
let body = new CheckGuild37Params(guildCode, serverId, 2, notice);
|
||||
noticeResult = await request37Post(SDK_37_ADDR.CHECK_UNION, body, SDK_37_CONST.CHAT_KEY);
|
||||
}
|
||||
@@ -83,7 +83,7 @@ export async function checkGuildName(guildCode: string, serverId: number, name:
|
||||
export async function treatRoleName(roleId: string) {
|
||||
let role = await RoleModel.findByRoleId(roleId);
|
||||
if(role && role.sdkMark) { // 有设置标记的情况下
|
||||
let newName = roleId;
|
||||
let newName = "默认玩家名";
|
||||
// 新名字上传
|
||||
await checkRoleName(roleId, newName, role);
|
||||
// 改名字
|
||||
@@ -112,7 +112,7 @@ export async function treatGuildName(content: string) {
|
||||
let guild = await GuildModel.findByCode(params.code, params.serverId);
|
||||
if(guild && guild.sdkMark) { // 有设置标记的情况下
|
||||
if(params.type == 1) { // 公会名
|
||||
let newName = guild.code;
|
||||
let newName = "默认公会名";
|
||||
// 新名字上传
|
||||
await checkGuildName(params.code, params.serverId, newName, undefined);
|
||||
await GuildModel.updateInfo(params.code, { name: newName, sdkMark: false });
|
||||
@@ -154,11 +154,12 @@ export function connectThinkingData(app: Application) {
|
||||
app.set('ta', ta);
|
||||
}
|
||||
|
||||
export function reportTAEvent(roleId: string, eventName: string, ip: string) {
|
||||
export function reportTAEvent(userCode: string, serverId: number, eventName: string, ip: string) {
|
||||
console.log(userCode, serverId)
|
||||
let ta = pinus.app.get('ta');
|
||||
let event = {
|
||||
// 账号 ID (可选)
|
||||
accountId: roleId,
|
||||
accountId: `${userCode}`,
|
||||
// 访客 ID (可选),账号 ID 和访客 ID 不可以都为空
|
||||
distinctId: "",
|
||||
// 事件名称 (必填)
|
||||
@@ -169,13 +170,10 @@ export function reportTAEvent(roleId: string, eventName: string, ip: string) {
|
||||
ip: ip,
|
||||
// 事件属性 (可选)
|
||||
properties: {
|
||||
prop_date: new Date(),
|
||||
prop_double: 134.1,
|
||||
prop_string: "hello world",
|
||||
prop_int: 67
|
||||
serverId
|
||||
},
|
||||
callback() {
|
||||
console.log('*****测试接入事件')
|
||||
callback(err) {
|
||||
console.log('*****测试接入事件', err)
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user