Commit a23b05bc by Sxy

fix: big bug

parent 5b5f93db
......@@ -7,26 +7,26 @@ class LoginTimesCache extends CacheBase {
super();
}
isdebug () {
isdebug() {
return false;
}
desc () {
desc() {
return "缓存登录错误次数信息";
}
prefix () {
return "g_login_times:"
prefix() {
return "g_login_times_:"
}
async buildCacheVal (cachekey, inputkey, val, ex, ...items) {
async buildCacheVal(cachekey, inputkey, val, ex, ...items) {
if (val) {
return val;
}
return null;
}
async incrAsync (key) {
async incrAsync(key) {
let cachekey = this.prefix + key
let cache = await this.getCache(key);
if (!cache) {
......
......@@ -162,15 +162,15 @@ class UserService extends ServiceBase {
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));
if (days >= settings.changepwdcycle) {//禁用用户
await this.dao.updateByWhere({ isEnabled: false }, { userName: p.userName })
return null
} else if ((settings.changepwdcycle - 7) <= days) {
rtn.hint = "请尽快修改密码,否则会禁用您的账户"
}
// let last = new Date(u.last_change_date).getTime();//注意月份
// let differ = Date.now() - last;
// let days = Math.round(differ / (24 * 60 * 60 * 1000));
// if (u.last_change_date && days >= settings.changepwdcycle) {//禁用用户
// await this.dao.updateByWhere({ isEnabled: false }, { userName: p.userName })
// return null
// } else if ((settings.changepwdcycle - 7) <= days) {
// rtn.hint = "请尽快修改密码,否则会禁用您的账户"
// }
return this.db.transaction(async function (t) {
//从缓存中取得
// 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