let userModel = sequelize.define('userModel',{
//Schema
},{
//options
instanceMethods:{
checkPassword(){}
}
})
.........
async Login(){
let ins = await userModel.findOne('xxx')
ins.checkPassword // <= is not a function
}
似乎在userModel.prototype
上没有加载instanceMethods。虽然我console.log(ins)
,checkPassword
存在于属性instanceMethods
中。
如何调用instanceMethods?
续集版本:4.11.1