WokerTask/app/api/controller/new/UserController.php

23 lines
599 B
PHP

<?php
namespace app\api\controller\new;
use app\api\controller\BaseApiController;
use app\api\logic\UserLogic;
use app\api\validate\RegisterValidate;
class UserController extends BaseApiController
{
public array $notNeedLogin = ['register'];
public function register()
{
// 用户注册逻辑
$params = (new RegisterValidate())->post()->goCheck('register');
$result = UserLogic::register($params);
if (true === $result) {
return $this->success('注册成功', [], 1, 1);
}
return $this->fail(UserLogic::getError());
}
}