jenkins:军团测试bug
This commit is contained in:
@@ -516,10 +516,12 @@ export class GuildHandler {
|
|||||||
let result = [];
|
let result = [];
|
||||||
for (let cur of list) {
|
for (let cur of list) {
|
||||||
let role = <RoleType>cur.role;
|
let role = <RoleType>cur.role;
|
||||||
delete role._id;
|
if(role) {
|
||||||
delete cur.role;
|
delete role._id;
|
||||||
let isOnline = await isRoleOnline(role.roleId)
|
delete cur.role;
|
||||||
result.push({ ...cur, ...role, isOnline: !!isOnline });
|
let isOnline = await isRoleOnline(role.roleId)
|
||||||
|
result.push({ ...cur, ...role, isOnline: !!isOnline });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let leader = result.shift();
|
let leader = result.shift();
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export class Client {
|
|||||||
private _roleInfo;
|
private _roleInfo;
|
||||||
private ENCRYPT_IV = 'f7182j5f04e377ux';
|
private ENCRYPT_IV = 'f7182j5f04e377ux';
|
||||||
private ENCRYPT_KEY = 'fiqaxijabbantusmprc234fj';
|
private ENCRYPT_KEY = 'fiqaxijabbantusmprc234fj';
|
||||||
|
private serverId = 1;
|
||||||
|
|
||||||
constructor(tel: string = '13636354764') {
|
constructor(tel: string = '13636354764') {
|
||||||
const param = {tel, deviceId: genCode(10), code: '', platform: 'ios', pkgName: 'com.bantu.zyz', serverType: 'dev'};
|
const param = {tel, deviceId: genCode(10), code: '', platform: 'ios', pkgName: 'com.bantu.zyz', serverType: 'dev'};
|
||||||
@@ -24,7 +25,7 @@ export class Client {
|
|||||||
checkSuccessResponse(loginRes);
|
checkSuccessResponse(loginRes);
|
||||||
request.post('http://127.0.0.1:7001/user/checkrole', {
|
request.post('http://127.0.0.1:7001/user/checkrole', {
|
||||||
json: {
|
json: {
|
||||||
data: this.aesEncrypt(JSON.stringify({token: loginRes.data.token, serverId: 1}), this.ENCRYPT_KEY, this.ENCRYPT_IV)
|
data: this.aesEncrypt(JSON.stringify({token: loginRes.data.token, serverId: this.serverId}), this.ENCRYPT_KEY, this.ENCRYPT_IV)
|
||||||
}
|
}
|
||||||
}, (err, res, body) => {
|
}, (err, res, body) => {
|
||||||
const checkRoleRes = JSON.parse(this.aesDecrypt(body.result, this.ENCRYPT_KEY, this.ENCRYPT_IV));
|
const checkRoleRes = JSON.parse(this.aesDecrypt(body.result, this.ENCRYPT_KEY, this.ENCRYPT_IV));
|
||||||
@@ -42,7 +43,7 @@ export class Client {
|
|||||||
createRole(token, sucCB) {
|
createRole(token, sucCB) {
|
||||||
request.post('http://127.0.0.1:7001/user/createrole', {
|
request.post('http://127.0.0.1:7001/user/createrole', {
|
||||||
json: {
|
json: {
|
||||||
data: this.aesEncrypt(JSON.stringify({token, serverId: 1}), this.ENCRYPT_KEY, this.ENCRYPT_IV)
|
data: this.aesEncrypt(JSON.stringify({token, serverId: this.serverId}), this.ENCRYPT_KEY, this.ENCRYPT_IV)
|
||||||
}
|
}
|
||||||
}, (err, res, body) => {
|
}, (err, res, body) => {
|
||||||
const result = JSON.parse(this.aesDecrypt(body.result, this.ENCRYPT_KEY, this.ENCRYPT_IV));
|
const result = JSON.parse(this.aesDecrypt(body.result, this.ENCRYPT_KEY, this.ENCRYPT_IV));
|
||||||
@@ -65,12 +66,12 @@ export class Client {
|
|||||||
expect(msg.data.roleId).to.be.a('string');
|
expect(msg.data.roleId).to.be.a('string');
|
||||||
expect(msg.data.channelName).to.be.a('string');
|
expect(msg.data.channelName).to.be.a('string');
|
||||||
});
|
});
|
||||||
this._client.request('connector.entryHandler.enter', { serverId: 1, token }, (enterRes) => {
|
this._client.request('connector.entryHandler.enter', { serverId: this.serverId, token }, (enterRes) => {
|
||||||
// 消息回调
|
// 消息回调
|
||||||
checkSuccessResponse(enterRes);
|
checkSuccessResponse(enterRes);
|
||||||
expect(enterRes.data.role).to.be.an('object');
|
expect(enterRes.data.role).to.be.an('object');
|
||||||
this._roleInfo = enterRes.data.role;
|
this._roleInfo = enterRes.data.role;
|
||||||
this._client.request('role.roleHandler.initRole', { serverId: 1, token, roleName: genCode(8) }, (initRoleRes) => {
|
this._client.request('role.roleHandler.initRole', { serverId: this.serverId, token, roleName: genCode(8) }, (initRoleRes) => {
|
||||||
if (initRoleRes.code !== 0 && initRoleRes.code !== STATUS.ROLE_HAS_INIT.code) {
|
if (initRoleRes.code !== 0 && initRoleRes.code !== STATUS.ROLE_HAS_INIT.code) {
|
||||||
console.error('initRole error', initRoleRes.code, typeof initRoleRes.code);
|
console.error('initRole error', initRoleRes.code, typeof initRoleRes.code);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user