✨ feat(37需求): 登录页面和加载页面支持上传
This commit is contained in:
@@ -76,8 +76,8 @@ export default class GameController extends Controller {
|
||||
// editPackage
|
||||
public async editPackage() {
|
||||
const { ctx } = this;
|
||||
const { regionId, pkgName, pkgDesc, pid, gid, isOpen } = ctx.request.body;
|
||||
ctx.body = await ctx.service.game.editPackage(regionId, pid, gid, pkgName, pkgDesc, isOpen);
|
||||
const { regionId, pkgName, pkgDesc, pid, gid, isOpen, loadingPage, loginPage } = ctx.request.body;
|
||||
ctx.body = await ctx.service.game.editPackage(regionId, pid, gid, pkgName, pkgDesc, isOpen, loadingPage, loginPage);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ const publishPath = '/root/hot_update_backup';
|
||||
import {exec} from 'child_process'
|
||||
import { reloadResources } from '@pubUtils/data';
|
||||
import { decodeArrayStr } from '@pubUtils/util';
|
||||
import { getLocalPopNoticeUrl, getLocalQrCodeUrl, getRemotePopNoticeUrl, getRemoteQrCodeUrl } from '@pubUtils/battleUtils';
|
||||
import { getLocalImgUrl, getLocalQrCodeUrl, getRemoteImgUrl, getRemoteQrCodeUrl } from '@pubUtils/battleUtils';
|
||||
const sendToWormhole = require('stream-wormhole');
|
||||
|
||||
export default class UploadController extends Controller {
|
||||
@@ -293,10 +293,10 @@ public async uploadQrCode() {
|
||||
|
||||
let filenames = part.filename.split('.');
|
||||
ext = filenames[filenames.length - 1];
|
||||
if(type == 'popNotice') {
|
||||
writePath = getLocalPopNoticeUrl(this.app.config.realEnv);
|
||||
if(type == 'popNotice'|| type == 'loginPage' || type == 'loadingPage') {
|
||||
writePath = getLocalImgUrl(this.app.config.realEnv, type);
|
||||
fileName = `${moment().valueOf()}.${ext}`;
|
||||
remoteUrl = getRemotePopNoticeUrl(this.app.config.realEnv, fileName);
|
||||
remoteUrl = getRemoteImgUrl(this.app.config.realEnv, fileName, type);
|
||||
} else {
|
||||
writePath = getLocalQrCodeUrl(this.app.config.realEnv, env);
|
||||
fileName = `QR${moment().valueOf()}.${ext}`;
|
||||
|
||||
@@ -90,9 +90,9 @@ export default class Game extends Service {
|
||||
}
|
||||
|
||||
// 更新推广包
|
||||
public async editPackage(regionId: number, pid: string, gid: string, pkgName: string, pkgDesc: string, isOpen = true) {
|
||||
public async editPackage(regionId: number, pid: string, gid: string, pkgName: string, pkgDesc: string, isOpen = true, loadingPage = '', loginPage = '') {
|
||||
const { ctx } = this;
|
||||
const packageInfo = await PackageModel.updatePackage({regionId, pkgName, pkgDesc, pid, gid, isOpen}, ctx.user?.uid);
|
||||
const packageInfo = await PackageModel.updatePackage({regionId, pkgName, pkgDesc, pid, gid, isOpen, loadingPage, loginPage}, ctx.user?.uid);
|
||||
if (!packageInfo) {
|
||||
return ctx.service.utils.resResult(STATUS.PACKAGE_UPDATE_FAILED);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user