聊天:添加屏蔽
This commit is contained in:
@@ -64,7 +64,6 @@ export default class AccountController extends Controller {
|
||||
|
||||
public async channelLogin() {
|
||||
const { ctx } = this;
|
||||
const { channelType, pst, clientId, deviceId, platform, pkgName, serverType, getuiCID } = ctx.request.body;
|
||||
ctx.body = await ctx.service.auth.channelLogin(channelType, clientId, pst, deviceId, platform, pkgName, serverType, getuiCID);
|
||||
ctx.body = await ctx.service.auth.channelLogin(ctx.request.body);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { STATUS } from '@consts';
|
||||
import { httpRequest } from 'app/pubUtils/httpUtil';
|
||||
import { Controller } from 'egg';
|
||||
import { PayCallback37Data } from '../domain/sdk';
|
||||
|
||||
@@ -14,15 +15,26 @@ export default class SdkController extends Controller {
|
||||
public async treatRoleName() {
|
||||
const { ctx } = this;
|
||||
|
||||
|
||||
let test = await httpRequest('http://127.0.0.1:7001/cb/treatguildname', "POST", {}, null);
|
||||
console.log('result: ', typeof test, test);
|
||||
ctx.body = ctx.service.utils.resResult(STATUS.SUCCESS, '');
|
||||
return;
|
||||
}
|
||||
|
||||
public async treatGuildName() {
|
||||
const { ctx } = this;
|
||||
let promiseFun = () => {
|
||||
return new Promise(resolve => {
|
||||
|
||||
ctx.body = ctx.service.utils.resResult(STATUS.SUCCESS, '');
|
||||
setTimeout(() => {
|
||||
resolve(ctx.service.utils.resResult(STATUS.SUCCESS, ''));
|
||||
}, 1000)
|
||||
})
|
||||
}
|
||||
ctx.body = await promiseFun();
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
public async getGuildByUser() {
|
||||
|
||||
@@ -386,21 +386,17 @@ export default class Auth extends Service {
|
||||
|
||||
/**
|
||||
* 渠道服登录
|
||||
* @param channelType 渠道类型 37: '37'
|
||||
* @param clientId
|
||||
* @param pst
|
||||
* @param deviceId
|
||||
* @param platform
|
||||
* @param pkgName
|
||||
* @param serverType
|
||||
* @param getuiCID
|
||||
* @returns
|
||||
*/
|
||||
public async channelLogin(channelType: string, clientId: string, pst: string, deviceId: string, platform: string, pkgName: string, serverType: string, getuiCID: string) {
|
||||
public async channelLogin(params: {
|
||||
channelType: string, pst: string, clientId: string, deviceId: string, platform: string, platformAppid: string, childGameId: number, pkgName: string, serverType: string, getuiCID: string
|
||||
}) {
|
||||
const { channelType, pst, clientId, deviceId, platform, platformAppid, childGameId, pkgName, serverType, getuiCID } = params;
|
||||
|
||||
const ctx = this.ctx;
|
||||
const ip = ctx.request.ip;
|
||||
|
||||
let requestResult = await loginValidata(channelType, clientId, pst)
|
||||
let requestResult = await loginValidata(channelType, { clientId, pst, platformAppid, childGameId });
|
||||
if(!requestResult) return this.ctx.service.utils.resResult(STATUS.CHANNEL_ERR);
|
||||
if(requestResult.code != 1) {
|
||||
return this.ctx.service.utils.resResult(STATUS.VALIDATE_ERR, requestResult);
|
||||
@@ -408,7 +404,9 @@ 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, requestResult.data, token, platform, pkgName, serverType, deviceId, ip);
|
||||
let user = await UserModel.createOrUpdateChannelUser(channelId, channelType, {
|
||||
...requestResult.data, childGameId, platformAppid
|
||||
}, token, platform, pkgName, serverType, deviceId, ip);
|
||||
if (getuiCID) {//更新个推cid
|
||||
await UserModel.updateGetuiCIDByChannel(channelId, getuiCID);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user