1.提交缺失的东西

This commit is contained in:
2025-05-16 15:43:21 +08:00
parent 19a38fb90c
commit ea5ecc2e47
2 changed files with 4 additions and 4 deletions

View File

@ -90,16 +90,16 @@ class UserAddressController extends BaseApiController
public function add() public function add()
{ {
$post = $this->request->post(); $post = $this->request->post();
$result = $this->validate($post, 'app\api\validate\UserAddress.add'); $result = $this->validate($post, 'app\api\validate\UserAddressValidate.add');
if ($result === true) { if ($result === true) {
$user_id = $this->userId; $user_id = $this->userId;
$result = UserAddressLogic::addUserAddress($user_id, $post); $result = UserAddressLogic::addUserAddress($user_id, $post);
if ($result) { if ($result) {
return $this->success('添加成功'); return $this->success('添加成功');
} }
return $result = '添加失败'; $result = '添加失败';
} }
$this->fail($result); return $this->fail($result);
} }

View File

@ -23,7 +23,7 @@ namespace app\api\validate;
use think\Validate; use think\Validate;
class UserAddress extends Validate class UserAddressValidate extends Validate
{ {
protected $rule = [ protected $rule = [