request->params([['code', '']]); $weapp_auth_service = new WeappAuthService(); return success($weapp_auth_service->login($data['code'])); //todo 执行登录操作 } /** * 注册 * @return Response * @throws InvalidArgumentException */ public function register(){ $data = $this->request->params([ ['openid', ''], ['mobile_code', ''], ['mobile', ''], ]); $weapp_auth_service = new WeappAuthService(); return success($weapp_auth_service->register($data['openid'], $data['mobile'], $data['mobile_code'])); } }