src / controllers / user.controller.ts(45,46):错误TS2554:预期0个参数,但得到1个

时间:2020-04-23 05:48:44

标签: mongoose

//比较密码

userSchema.methods.comparePassword = async function(password: string ): Promise<boolean> {
    return await bcrypt.compare(password, this.password);
}

并且您调用的函数密码是一个字符串。

const ismatch = await user.comparePassword(password);

0 个答案:

没有答案