Merge branch 'master' into feature/backend

# Conflicts:
#	game-server/app/servers/connector/handler/entryHandler.ts
#	game-server/app/servers/role/handler/itemHandler.ts
#	shared/consts/constModules/sysConst.ts
#	shared/pubUtils/util.ts
#	web-server/app.ts
#	web-server/app/service/Auth.ts
This commit is contained in:
luying
2021-12-14 18:08:44 +08:00
98 changed files with 10245 additions and 4858 deletions
+8 -4
View File
@@ -1,5 +1,5 @@
import { COUNTER, DEFAULT_LV, ADULT_AGE, GUEST_MAX_TIME, TASK_TYPE, BLOCK_TYPE } from '@consts';
import { COUNTER, DEFAULT_LV, ADULT_AGE, GUEST_MAX_TIME, TASK_TYPE, BLOCK_TYPE, TA_EVENT } from '@consts';
import { RoleModel } from '@db/Role';
import { UserModel, UserType } from '@db/User';
import { STATUS, GET_SMS_TYPE, ADDICTION_PREVENTION_CODE } from '@consts';
@@ -396,9 +396,9 @@ export default class Auth extends Service {
* @returns
*/
public async channelLogin(params: {
channelType: string, pst: string, clientId: string, deviceId: string, platform: string, platformAppid: string, childGameId: number, pkgName: string, serverType: string, getuiCID: string
channelType: string, pst: string, clientId: string, deviceId: string, platform: string, platformAppid: string, childGameId: number, pkgName: string, serverType: string, getuiCID: string, distinctId: string
}) {
const { channelType, pst, clientId, deviceId, platform, platformAppid, childGameId, pkgName, serverType, getuiCID } = params;
const { channelType, pst, clientId, deviceId, platform, platformAppid, childGameId, pkgName, serverType, getuiCID, distinctId } = params;
const ctx = this.ctx;
@@ -411,9 +411,13 @@ export default class Auth extends Service {
let channelId = getChannelId(channelType, requestResult.data.uid);
const token = ctx.service.utils.generateStr(256);
let user = await UserModel.createOrUpdateChannelUser(channelId, channelType, {
let { isCreate, user} = await UserModel.createOrUpdateChannelUser(channelId, channelType, {
...requestResult.data, childGameId, platformAppid
}, token, platform, pkgName, serverType, deviceId, ctx.clientIp);
if(isCreate) {
ctx.service.sdk.reportTAEventWithDistinctId(distinctId, TA_EVENT.REGISTER, null, ctx.clientIp);
}
if (getuiCID) {//更新个推cid
await UserModel.updateGetuiCIDByChannel(channelId, getuiCID);
}