From f6e6cfa71c6f7425dd41991c6473d701cdf27b55 Mon Sep 17 00:00:00 2001 From: whyour Date: Thu, 13 Jan 2022 22:38:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=8E=AF=E5=A2=83=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/api/cron.ts | 2 +- back/api/env.ts | 2 +- back/services/env.ts | 2 +- back/services/open.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/back/api/cron.ts b/back/api/cron.ts index f748f840..2c9f292a 100644 --- a/back/api/cron.ts +++ b/back/api/cron.ts @@ -189,7 +189,7 @@ export default (app: Router) => { '/', celebrate({ body: Joi.object({ - labels: Joi.array().optional(), + labels: Joi.array().optional().allow(null), command: Joi.string().optional(), schedule: Joi.string().optional(), name: Joi.string().optional(), diff --git a/back/api/env.ts b/back/api/env.ts index aaf57b30..05767b39 100644 --- a/back/api/env.ts +++ b/back/api/env.ts @@ -50,7 +50,7 @@ export default (app: Router) => { body: Joi.object({ value: Joi.string().required(), name: Joi.string().required(), - remarks: Joi.string().optional().allow(''), + remarks: Joi.string().optional().allow('').allow(null), id: Joi.number().required(), }), }), diff --git a/back/services/env.ts b/back/services/env.ts index cb8762d1..ad6c951d 100644 --- a/back/services/env.ts +++ b/back/services/env.ts @@ -87,7 +87,7 @@ export default class EnvService { const encodeText = encodeURIComponent(searchText); const reg = { [Op.or]: [ - { [Op.like]: `%${searchText}&` }, + { [Op.like]: `%${searchText}%` }, { [Op.like]: `%${encodeText}%` }, ], }; diff --git a/back/services/open.ts b/back/services/open.ts index c49c0735..388587c8 100644 --- a/back/services/open.ts +++ b/back/services/open.ts @@ -69,7 +69,7 @@ export default class OpenService { const encodeText = encodeURIComponent(searchText); const reg = { [Op.or]: [ - { [Op.like]: `%${searchText}&` }, + { [Op.like]: `%${searchText}%` }, { [Op.like]: `%${encodeText}%` }, ], };