19 lines
483 B
JavaScript
19 lines
483 B
JavaScript
|
|
const app = require('vn-loopback/server/server');
|
|
|
|
module.exports = Self => {
|
|
Self.getSynchronizer = async function() {
|
|
return await Self.findOne({fields: ['id']});
|
|
};
|
|
|
|
Object.assign(Self.prototype, {
|
|
async syncUser(userName, info, password) {
|
|
if (!info.hasAccount || !password) return;
|
|
|
|
await app.models.VnUser.rawSql('CALL pbx.sip_setPassword(?, ?)',
|
|
[info.user.id, password]
|
|
);
|
|
}
|
|
});
|
|
};
|