diff --git a/game-server/app/servers/activity/remote/activityRemote.ts b/game-server/app/servers/activity/remote/activityRemote.ts index b3b624c6d..9095469b4 100644 --- a/game-server/app/servers/activity/remote/activityRemote.ts +++ b/game-server/app/servers/activity/remote/activityRemote.ts @@ -102,7 +102,9 @@ export class ActivityRemote { public async saveActivitiesToGroup(groupId: number, activities: number[]) { for(let activityId of activities) { - this.activities.get(activityId).groupId = groupId; + if(this.activities.get(activityId)) { + this.activities.get(activityId).groupId = groupId; + } } this.setActivityTypeAndServer(); } diff --git a/game-server/app/servers/gm/handler/gmHandler.ts b/game-server/app/servers/gm/handler/gmHandler.ts index 650f251e1..3df1454e4 100644 --- a/game-server/app/servers/gm/handler/gmHandler.ts +++ b/game-server/app/servers/gm/handler/gmHandler.ts @@ -151,8 +151,8 @@ export class GmHandler { }); } let activities = await ActivityModel.findActivityByIds(aids); - let checkTimeResult = await checkActivityEditable(activities); - if(!checkTimeResult) return resResult(STATUS.GM_CAN_NOT_EDIT_ACT); + // let checkTimeResult = await checkActivityEditable(activities); + // if(!checkTimeResult) return resResult(STATUS.GM_CAN_NOT_EDIT_ACT); let checkGroup = await checkActivityGroupTypeWithId(groupId, activities); if(!checkGroup) return resResult(STATUS.GM_ACTIVITY_NOT_FIT_GROUP_TYPE); @@ -176,6 +176,7 @@ export class GmHandler { if (!result) { return resResult(STATUS.ACTIVITY_MISSING); } + await ActivityGroupModel.pullByActivityIds([activityId]); let activityServers = pinus.app.getServersByType('activity'); for(let server of activityServers) { pinus.app.rpc.activity.activityRemote.deleteActivities.toServer(server.id, [activityId]); diff --git a/game-server/app/services/mailService.ts b/game-server/app/services/mailService.ts index c07bf631a..9f3f4a243 100644 --- a/game-server/app/services/mailService.ts +++ b/game-server/app/services/mailService.ts @@ -100,7 +100,7 @@ export class SendMailFun { this.goods = params.goods||[]; } - getContent(content: string, params: string[]) { + getContent(content: string, params: string[] = []) { if(!content) content = '%d'; for(let p of params) { content = content.replace(/%d/, p); diff --git a/gm-server/app/controller/login.ts b/gm-server/app/controller/login.ts index f796a55d1..c86efd7ae 100644 --- a/gm-server/app/controller/login.ts +++ b/gm-server/app/controller/login.ts @@ -11,9 +11,7 @@ export default class LoginController extends Controller { public async currentUser() { const { ctx } = this; - ctx.body = ctx.service.utils.resResult(STATUS.SUCCESS, { - "user": ctx.user - }); + ctx.body = ctx.service.gmUser.currentUser(); } public async changeMyPass() { diff --git a/gm-server/app/service/GmUser.ts b/gm-server/app/service/GmUser.ts index 1d954c940..a8619c03b 100644 --- a/gm-server/app/service/GmUser.ts +++ b/gm-server/app/service/GmUser.ts @@ -40,6 +40,11 @@ export default class GMUsers extends Service { } } + public async currentUser() { + const {ctx} = this; + + } + /** * 修改我的密码 */ diff --git a/shared/pubUtils/taskUtil.ts b/shared/pubUtils/taskUtil.ts index 15cc46e49..0701d9bdd 100644 --- a/shared/pubUtils/taskUtil.ts +++ b/shared/pubUtils/taskUtil.ts @@ -495,10 +495,10 @@ export async function accomplishTask(serverId: number, roleId: string, taskType: if(activities) { let result: ActivityModelType[] = []; for(let activity of activities) { - // getActivities -> activities 获取所有结束时间在当前以后的活动 - // types: 活动类型 - if(activityGroupId.includes(activity.groupId) && types.includes(activity.type)) { - result.push(activity); + if(activity.beginTime <= new Date() && activity.endTime >= new Date()) { + if(activityGroupId.includes(activity.groupId) && types.includes(activity.type)) { + result.push(activity); + } } } return result;