💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
[toc] ## pre ``` UserSchema.pre('save', function (next) { //第一步先生成盐值 bcrypt.genSalt((err, salt) => { //通过原始的密码和盐值计算哈希值 bcrypt.hash(this.password, salt, (err, hash) => { this.password = hash; next(); }); }); }); ```