diff --git a/server/src/iot/entrance/access.ts b/server/src/iot/entrance/access.ts index db032ce..52970fb 100644 --- a/server/src/iot/entrance/access.ts +++ b/server/src/iot/entrance/access.ts @@ -96,7 +96,8 @@ async function accessMethod(params: AccessParams, entranceInfo: EjyyIotEntrance, } if (reuslt.type === VISTOR_ACCESS_CODE) { - const vistorInfo = await model.from('ejyy_vistor') + const vistorInfo = await model + .from('ejyy_vistor') .where('id', reuslt.id) .first(); diff --git a/server/src/module/mp/controller/vistor/create.ts b/server/src/module/mp/controller/vistor/create.ts index a3bdb6f..1159f3b 100644 --- a/server/src/module/mp/controller/vistor/create.ts +++ b/server/src/module/mp/controller/vistor/create.ts @@ -64,7 +64,11 @@ const MpVistorCreateAction = { { name: 'expire', regex: /^\d{13}$/, - validator: val => Date.now() < moment(val).endOf('day').valueOf(), + validator: val => + Date.now() < + moment(val) + .endOf('day') + .valueOf(), required: true } ] diff --git a/server/src/module/pc/controller/ower/detail.ts b/server/src/module/pc/controller/ower/detail.ts index 0415f28..2436d3b 100644 --- a/server/src/module/pc/controller/ower/detail.ts +++ b/server/src/module/pc/controller/ower/detail.ts @@ -12,6 +12,7 @@ import { Action } from '~/types/action'; import { SUCCESS, QUERY_ILLEFAL } from '~/constant/code'; +import { FALSE } from '~/constant/status'; import * as ROLE from '~/constant/role_access'; interface RequestBody { @@ -96,10 +97,19 @@ const PcOwerDetailAction = { ); if (buildings.length === 0) { - return (ctx.body = { - code: QUERY_ILLEFAL, - message: '非法获取用户信息' - }); + const existApply = await ctx.model + .from('ejyy_ower_apply') + .where('community_id', community_id) + .andWhere('wechat_mp_user_id', id) + .andWhere('success', FALSE) + .first(); + + if (!existApply) { + return (ctx.body = { + code: QUERY_ILLEFAL, + message: '非法获取用户信息' + }); + } } const cars = await ctx.model