我尝试使用下列代码获取请求结果,但获得了一个y意外的结果:
import { Injectable } from '@nestjs/common';
import { HttpService } from '@nestjs/axios';
@Injectable()
export class RecaptchaService {
constructor(private httpService: HttpService) {}
verifyResponse(reCAPTCHAToken: string, clientIp: string): number {
const checkResult = this.httpService.post(
'https://www.recaptcha.net/recaptcha/api/siteverify',
secret: 'AAAA',
response: reCAPTCHAToken,
remote: clientIp,
console.log(checkResult);
return 0.2;
}
结果:
Observable {
source: Observable { _subscribe: [Function (anonymous)] },
operator: [Function (anonymous)]
}