request->params([ ['username', ''], ['password', ''], ['mobile', ''], [ 'wx_openid', '' ] ]); //校验登录注册配置 ( new ConfigService() )->checkLoginConfig(MemberLoginTypeDict::USERNAME); //参数验证 $this->validate($data, 'app\validate\member\Member.account_register'); //验证码验证 $result = (new RegisterService())->account($data['username'], $data['password'], $data['mobile'], $data[ 'wx_openid' ]); return success($result); } /** * 手机号注册 * @return Response */ public function mobile() { $data = $this->request->params([ ['mobile', ''], ]); //校验登录注册配置 ( new ConfigService() )->checkLoginConfig(MemberLoginTypeDict::MOBILE); //参数验证 $this->validate($data, [ 'mobile' => 'require|mobile' ]); //验证码验证 $result = (new RegisterService())->mobile($data['mobile']); return success($result); } }