Commit 32455d75 by Sxy

fix: 注释

parent 5e09b037
...@@ -159,21 +159,20 @@ class UserService extends ServiceBase { ...@@ -159,21 +159,20 @@ class UserService extends ServiceBase {
var rtn = {} var rtn = {}
let u = await this.findOne({ userName: p.userName }); let u = await this.findOne({ userName: p.userName });
let inpassword = this.getEncryptStr(p.password); let inpassword = this.getEncryptStr(p.password);
console.log('---- 密码------');
console.log(u.password);
console.log(inpassword);
if (u.password != inpassword) { if (u.password != inpassword) {
return null; return null;
} }
let last = new Date(u.last_change_date).getTime();//注意月份 console.log('---- 密码------');
let differ = Date.now() - last; console.log(u.last_change_date);
let days = Math.round(differ / (24 * 60 * 60 * 1000)); // let last = new Date(u.last_change_date).getTime();//注意月份
if (u.last_change_date && days >= settings.changepwdcycle) {//禁用用户 // let differ = Date.now() - last;
await this.dao.updateByWhere({ isEnabled: false }, { userName: p.userName }) // let days = Math.round(differ / (24 * 60 * 60 * 1000));
return null // if (u.last_change_date && days >= settings.changepwdcycle) {//禁用用户
} else if ((settings.changepwdcycle - 7) <= days) { // await this.dao.updateByWhere({ isEnabled: false }, { userName: p.userName })
rtn.hint = "请尽快修改密码,否则会禁用您的账户" // return null
} // } else if ((settings.changepwdcycle - 7) <= days) {
// rtn.hint = "请尽快修改密码,否则会禁用您的账户"
// }
return this.db.transaction(async function (t) { return this.db.transaction(async function (t) {
//从缓存中取得 //从缓存中取得
// let userfind = await self.dao.model.findOne({ // let userfind = await self.dao.model.findOne({
......
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