fix(auth): fail closed on token and validation checks

Made-with: Cursor
This commit is contained in:
apple
2026-04-29 17:32:08 +08:00
parent d6b9d1d0e3
commit 7e9c5105bb
5 changed files with 31 additions and 6 deletions

View File

@@ -7,6 +7,7 @@ namespace app\common\controller;
use app\Request;
use think\App;
use think\exception\ValidateException;
use think\Response;
/**
@@ -73,6 +74,10 @@ abstract class AppBaseController
$validator->message($scene);
}
return $validator->check($data);
if (!$validator->check($data)) {
throw new ValidateException($validator->getError());
}
return true;
}
}