我一生都无法弄清楚在 vue 中将验证码传递给confirmSignUp 时出了什么问题。这是代码:
const username = this.email;
const code = this.verificationCode;
console.log('Username passed to confirmSignUp:', username);
console.log('Verification code passed to confirmSignUp:', code);
await confirmSignUp({
username: username,
code: code,
});
The console logs are printing the correct information to be passed to the function, but the function throws this error:
Error verifying code: EmptyConfirmSignUpCode: code is required to confirmSignUp
at assertValidationError
我尝试将参数作为单独的对象传递,但文档似乎暗示需要单个对象,并且在传递单独的对象时无法识别用户名。我尝试直接从输入字段引用代码,但没有任何区别。我确信放大设置或函数调用本身有问题,因为就像我说的,正确的值被记录到控制台,然后函数调用只是看不到它们。 FWIW,这与我调用其他放大函数的方式相同,这是唯一一个拒绝工作的函数。任何见解将不胜感激。
正确的参数是confirmationCode,而不是code,这解决了问题