🐞 fix(gvg): 激战期录像上传特殊处理
This commit is contained in:
@@ -193,7 +193,7 @@ export default class GameController extends Controller {
|
|||||||
const { ctx } = this;
|
const { ctx } = this;
|
||||||
const parts = ctx.multipart();
|
const parts = ctx.multipart();
|
||||||
let part;
|
let part;
|
||||||
let [writePath, token, battleCode, fullPath, remoteUrl] = ['', '', '', '', ''];
|
let [writePath, token, battleCode, fullPath, remoteUrl, warType] = ['', '', '', '', '', 0];
|
||||||
while ((part = await parts()) != null) {
|
while ((part = await parts()) != null) {
|
||||||
if (part.length) {
|
if (part.length) {
|
||||||
console.log('kv: ', `${part[0]}: ${part[1]}`);
|
console.log('kv: ', `${part[0]}: ${part[1]}`);
|
||||||
@@ -201,6 +201,8 @@ export default class GameController extends Controller {
|
|||||||
token = part[1];
|
token = part[1];
|
||||||
} else if (part[0] === 'battleCode') {
|
} else if (part[0] === 'battleCode') {
|
||||||
battleCode = part[1];
|
battleCode = part[1];
|
||||||
|
} else if (part[0] === 'warType') {
|
||||||
|
warType = part[1];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!part.filename) {
|
if (!part.filename) {
|
||||||
@@ -221,11 +223,19 @@ export default class GameController extends Controller {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let battleRec = await BattleRecordModel.getBattleRecordByCode(battleCode, true);
|
let roleId = '';
|
||||||
if (!battleRec) return ctx.body = ctx.service.utils.resResult(STATUS.BATTLE_NOT_FOUND);
|
if (!!warType && warType === WAR_TYPE.GVG_BATTLE) { // gvg激战期录像,没有通用 BattleRecord,单独处理
|
||||||
|
let gvgBattleRec = await GVGBattleRecModel.findByBattleCode(battleCode);
|
||||||
let { warType, roleId } = battleRec;
|
if (!gvgBattleRec) return ctx.body = ctx.service.utils.resResult(STATUS.BATTLE_NOT_FOUND);
|
||||||
if (warType !== WAR_TYPE.PVP && warType !== WAR_TYPE.LADDER && warType !== WAR_TYPE.GVG_VESTIGE && warType !== WAR_TYPE.GVG_BATTLE) return ctx.body = ctx.service.utils.resResult(STATUS.BATTLE_RPL_NOT_SUPPORT);
|
roleId = gvgBattleRec.attackTeam?.roleId;
|
||||||
|
if (!roleId) return ctx.body = ctx.service.utils.resResult(STATUS.BATTLE_NOT_FOUND);
|
||||||
|
} else {
|
||||||
|
let battleRec = await BattleRecordModel.getBattleRecordByCode(battleCode, true);
|
||||||
|
if (!battleRec) return ctx.body = ctx.service.utils.resResult(STATUS.BATTLE_NOT_FOUND);
|
||||||
|
roleId = battleRec.roleId;
|
||||||
|
warType = battleRec.warType;
|
||||||
|
if (warType !== WAR_TYPE.PVP && warType !== WAR_TYPE.LADDER && warType !== WAR_TYPE.GVG_VESTIGE) return ctx.body = ctx.service.utils.resResult(STATUS.BATTLE_RPL_NOT_SUPPORT);
|
||||||
|
}
|
||||||
|
|
||||||
writePath = getLocalRplUrl(roleId, warType, battleCode);
|
writePath = getLocalRplUrl(roleId, warType, battleCode);
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user