Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
d8ccde86
Commit
d8ccde86
authored
Aug 24, 2020
by
王悦
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/center-manage' into center-manage
parents
b60b65d1
8a5c2404
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
14 deletions
+11
-14
center-manage/.gitignore
+1
-2
center-manage/app/base/service/impl/auth/userSve.js
+9
-11
center-manage/app/config/settings.js
+1
-1
No files found.
center-manage/.gitignore
View file @
d8ccde86
node_modules/
app/config/localsettings.js
app/front/entry/public/
\ No newline at end of file
app/front/entry/public/
center-manage/app/base/service/impl/auth/userSve.js
View file @
d8ccde86
...
...
@@ -162,17 +162,15 @@ class UserService extends ServiceBase {
if
(
u
.
password
!=
inpassword
)
{
return
null
;
}
console
.
log
(
'---- 密码------'
);
console
.
log
(
u
.
last_change_date
);
// 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 = "请尽快修改密码,否则会禁用您的账户"
// }
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({
...
...
center-manage/app/config/settings.js
View file @
d8ccde86
...
...
@@ -20,7 +20,7 @@ var settings = {
encrypt_secret
:
ENVINPUT
.
ENCRYPT_SECRET
,
salt
:
"%iatpD1gcxz7iF#B"
,
defaultpwd
:
"Temp123456"
,
changepwdcycle
:
60
,
//密码更换周期 7天前登录提示更改密码 到期后直接禁用账户
changepwdcycle
:
365
,
//密码更换周期 7天前登录提示更改密码 到期后直接禁用账户
basepath
:
path
.
normalize
(
path
.
join
(
__dirname
,
'../..'
)),
port
:
process
.
env
.
NODE_PORT
||
80
,
logindex
:
"center_manage"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment