后台:添加操作日志
This commit is contained in:
11
gm-server/app/controller/log.ts
Normal file
11
gm-server/app/controller/log.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Controller } from 'egg';
|
||||
|
||||
export default class LogController extends Controller {
|
||||
|
||||
public async getGmLog() {
|
||||
const { ctx } = this;
|
||||
const { pageSize, page, form } = ctx.request.body;
|
||||
ctx.body = await ctx.service.log.getGmLog(page, pageSize, form);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -94,4 +94,6 @@ export default (app: Application) => {
|
||||
router.post('/api/mail/updatesinglemailtxt', tokenParser, controller.mail.updateGMMail);
|
||||
router.post('/api/mail/updateservermail', tokenParser, controller.mail.updateGMMail);
|
||||
router.post('/api/mail/updateservermailtxt', tokenParser, controller.mail.updateGMMail);
|
||||
|
||||
router.post('/api/log/getgmlog', controller.log.getGmLog);
|
||||
};
|
||||
|
||||
@@ -101,6 +101,7 @@ export default class GMUsers extends Service {
|
||||
return this.ctx.service.utils.resResult(STATUS.INTERNAL_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建后台账号
|
||||
*/
|
||||
|
||||
21
gm-server/app/service/Log.ts
Normal file
21
gm-server/app/service/Log.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Service } from 'egg';
|
||||
import { STATUS } from '@consts';
|
||||
import { SearchLogParam } from '@domain/backEndField/search';
|
||||
import { GMRecordModel } from '@db/GMRecord';
|
||||
|
||||
/**
|
||||
* Test Service
|
||||
*/
|
||||
export default class Log extends Service {
|
||||
|
||||
/**
|
||||
* 修改用户组
|
||||
*/
|
||||
public async getGmLog(page: number, pageSize: number, form: SearchLogParam) {
|
||||
const {ctx} = this;
|
||||
|
||||
let list = await GMRecordModel.findByCondition(page, pageSize, form);
|
||||
return ctx.service.utils.resResult(STATUS.SUCCESS, { list });
|
||||
}
|
||||
|
||||
}
|
||||
2
gm-server/typings/app/controller/index.d.ts
vendored
2
gm-server/typings/app/controller/index.d.ts
vendored
@@ -6,6 +6,7 @@ import ExportActivity from '../../../app/controller/activity';
|
||||
import ExportGame from '../../../app/controller/game';
|
||||
import ExportGmaccount from '../../../app/controller/gmaccount';
|
||||
import ExportHome from '../../../app/controller/home';
|
||||
import ExportLog from '../../../app/controller/log';
|
||||
import ExportLogin from '../../../app/controller/login';
|
||||
import ExportMail from '../../../app/controller/mail';
|
||||
import ExportUpload from '../../../app/controller/upload';
|
||||
@@ -17,6 +18,7 @@ declare module 'egg' {
|
||||
game: ExportGame;
|
||||
gmaccount: ExportGmaccount;
|
||||
home: ExportHome;
|
||||
log: ExportLog;
|
||||
login: ExportLogin;
|
||||
mail: ExportMail;
|
||||
upload: ExportUpload;
|
||||
|
||||
2
gm-server/typings/app/service/index.d.ts
vendored
2
gm-server/typings/app/service/index.d.ts
vendored
@@ -9,6 +9,7 @@ type AutoInstanceType<T, U = T extends CanExportFunc ? T : T extends AnyFunc ? R
|
||||
import ExportActivity from '../../../app/service/Activity';
|
||||
import ExportGame from '../../../app/service/Game';
|
||||
import ExportGmUser from '../../../app/service/GmUser';
|
||||
import ExportLog from '../../../app/service/Log';
|
||||
import ExportMail from '../../../app/service/Mail';
|
||||
import ExportTest from '../../../app/service/Test';
|
||||
import ExportUtils from '../../../app/service/Utils';
|
||||
@@ -19,6 +20,7 @@ declare module 'egg' {
|
||||
activity: AutoInstanceType<typeof ExportActivity>;
|
||||
game: AutoInstanceType<typeof ExportGame>;
|
||||
gmUser: AutoInstanceType<typeof ExportGmUser>;
|
||||
log: AutoInstanceType<typeof ExportLog>;
|
||||
mail: AutoInstanceType<typeof ExportMail>;
|
||||
test: AutoInstanceType<typeof ExportTest>;
|
||||
utils: AutoInstanceType<typeof ExportUtils>;
|
||||
|
||||
Reference in New Issue
Block a user