退款失败测试

This commit is contained in:
2024-12-03 09:12:44 +08:00
parent 2e9d6e4e72
commit 449fbf836d

View File

@@ -117,17 +117,12 @@ class FinanceController extends BaseAdminController
{
$identity = \Yii::$app->user->identity;
ds(json_encode(\Yii::$app->user));
if ($identity != 10) {
if ($identity->role != 10) {
throw new Exception('权限不足,仅超管有权限退款');
}
// 获取前端传递的POST数据
try {
$post = \Yii::$app->request->post();
} catch (\Exception $e) {
throw new Exception('参数错误'. $e->getMessage(). '--'. $e->getLine());
}
$post = \Yii::$app->request->post();
// 对必要的字段进行验证
$this->requestValidate($post, [