✨ feat(测试): 自动测试用删除账号接口
This commit is contained in:
@@ -66,4 +66,10 @@ export default class AccountController extends Controller {
|
||||
const { ctx } = this;
|
||||
ctx.body = await ctx.service.auth.channelLogin(ctx.request.body);
|
||||
}
|
||||
|
||||
public async deleteRole() {
|
||||
const { ctx } = this;
|
||||
const { roleId, magicWord } = ctx.request.body;
|
||||
ctx.body = await ctx.service.auth.deleteRole(roleId, magicWord);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ export default (app: Application) => {
|
||||
router.post('/user/authentication', tokenParser, controller.account.authentication);
|
||||
router.post('/user/checkversion', tokenParser, controller.game.checkVersion);
|
||||
router.post('/user/checkv', tokenParser, controller.game.checkVersion); // 增加一个接口,规避 iOS 敏感词
|
||||
router.post('/user/deleterole', controller.account.deleteRole);
|
||||
router.post('/game/getserverlist', tokenParser, controller.game.getServerList);
|
||||
router.post('/game/getnotice', tokenParser, controller.game.getnotice);
|
||||
router.post('/gate/queryenter', tokenParser, controller.game.queryEnter);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
import { COUNTER, DEFAULT_LV, ADULT_AGE, GUEST_MAX_TIME, BLOCK_TYPE } from '@consts';
|
||||
import { COUNTER, DEFAULT_LV, ADULT_AGE, GUEST_MAX_TIME, BLOCK_TYPE, DEBUG_MAGIC_WORD } from '@consts';
|
||||
import { RoleModel, WarStar } from '@db/Role';
|
||||
import { UserModel, UserType } from '@db/User';
|
||||
import { STATUS, GET_SMS_TYPE, ADDICTION_PREVENTION_CODE } from '@consts';
|
||||
@@ -9,14 +9,15 @@ import Counter from '@db/Counter';
|
||||
import { gameData, getExpByLv } from '../pubUtils/data';
|
||||
import { isString } from 'underscore';
|
||||
import { getAge, nowSeconds } from '../pubUtils/timeUtil';
|
||||
import { resResult } from '../pubUtils/util';
|
||||
import { isDevelopEnv, resResult } from '../pubUtils/util';
|
||||
import { checkTeeanAgerTime } from '../pubUtils/authenticateUtil';
|
||||
// import { authenticate } from '../pubUtils/httpUtil';
|
||||
import { getChannelId, loginValidata } from '../pubUtils/sdkUtil';
|
||||
import { LoginValidateData37 } from 'app/domain/sdk';
|
||||
import { ServerlistModel } from '@db/Serverlist';
|
||||
import { DicWar } from 'app/pubUtils/dictionary/DicWar';
|
||||
import { DicWar } from '../pubUtils/dictionary/DicWar';
|
||||
import { RScriptRecordModel } from '@db/RScriptRecord';
|
||||
import { deletRole } from '../pubUtils/roleUtil';
|
||||
|
||||
/**
|
||||
* Test Service
|
||||
@@ -465,4 +466,19 @@ export default class Auth extends Service {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public async deleteRole(roleId: string, magicWord: string) {
|
||||
console.log('enter Auth deleteRole');
|
||||
const ctx = this.ctx;
|
||||
if(magicWord != DEBUG_MAGIC_WORD) {
|
||||
return ctx.service.utils.resResult(STATUS.WRONG_PARMS);
|
||||
}
|
||||
if(!isDevelopEnv(ctx.app.config.realEnv)) {
|
||||
return ctx.service.utils.resResult(STATUS.DEVELOP_ONLY);
|
||||
}
|
||||
let result = await deletRole(roleId);
|
||||
if(!result) return ctx.service.utils.resResult(STATUS.WRONG_PARMS);
|
||||
return ctx.service.utils.resResult(STATUS.SUCCESS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user