Commit 5b5f93db by Sxy

fix : bug

parent 146cb174
......@@ -157,19 +157,19 @@ class UserService extends ServiceBase {
return null;
}
var rtn = {}
let u = await this.findOne({userName:p.userName});
let u = await this.findOne({ userName: p.userName });
let inpassword = this.getEncryptStr(p.password);
if (u.password != inpassword) {
return null;
}
let last = new Date(u.last_change_date).getTime();//注意月份
let differ = Date.now() - last ;
let days = Math.round(differ/(24*60*60*1000));
let differ = Date.now() - last;
let days = Math.round(differ / (24 * 60 * 60 * 1000));
if (days >= settings.changepwdcycle) {//禁用用户
await this.dao.updateByWhere({isEnabled: false}, {userName: p.userName})
await this.dao.updateByWhere({ isEnabled: false }, { userName: p.userName })
return null
}else if ((settings.changepwdcycle-7) <= days){
rtn.hint="请尽快修改密码,否则会禁用您的账户"
} else if ((settings.changepwdcycle - 7) <= days) {
rtn.hint = "请尽快修改密码,否则会禁用您的账户"
}
return this.db.transaction(async function (t) {
//从缓存中取得
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment