mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
build: 1.3.5
This commit is contained in:
parent
b21bc17a58
commit
9bfa6b827b
@ -10,7 +10,7 @@ class BaseAction<PayloadType, ReturnDataType> {
|
||||
PayloadSchema: any = undefined;
|
||||
protected async check(payload: PayloadType): Promise<BaseCheckResult> {
|
||||
if (this.PayloadSchema) {
|
||||
this.validate = new Ajv().compile(this.PayloadSchema);
|
||||
this.validate = new Ajv({ allowUnionTypes: true }).compile(this.PayloadSchema);
|
||||
}
|
||||
if (this.validate && !this.validate(payload)) {
|
||||
const errors = this.validate.errors as ErrorObject[];
|
||||
|
Loading…
x
Reference in New Issue
Block a user