Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gdtel-gztel-school-center-ui
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
吴学德
gdtel-gztel-school-center-ui
Commits
48f6dc20
Commit
48f6dc20
authored
Apr 13, 2020
by
黄森林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
密码修改
parent
a009a81a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
199 additions
and
48 deletions
+199
-48
src/api/system.js
+1
-1
src/components/tools/UserMenu.vue
+6
-0
src/components/tools/UserPassword.vue
+93
-6
src/views/school-center/product/product.vue
+6
-0
src/views/system/systemUser.vue
+86
-36
src/views/user/Login.vue
+4
-1
src/views/user/register.vue
+3
-4
No files found.
src/api/system.js
View file @
48f6dc20
...
...
@@ -19,7 +19,7 @@ let roleTreeList = (params) => postAction(prefix+"/role/roleTreeListByUserId", p
let
roleTreeList2
=
(
params
)
=>
postAction
(
prefix
+
"/role/roleTreeListByUserId/"
+
params
[
"id"
],
{});
let
userFreeze
=
(
params
)
=>
postAction
(
prefix
+
"/mgr/freeze"
,
params
);
let
userUnFreeze
=
(
params
)
=>
postAction
(
prefix
+
"/mgr/unfreeze"
,
params
);
let
changeOtherPwd
=
(
params
)
=>
postAction
(
prefix
+
"/
forgerpw
/changeOtherPwd"
,
params
);
//修改密码
let
changeOtherPwd
=
(
params
)
=>
postAction
(
prefix
+
"/
mgr
/changeOtherPwd"
,
params
);
//修改密码
//部门管理
const
departmentList
=
(
params
)
=>
getAction
(
prefix
+
"/dept/departmentList"
,
params
);
let
deptAdd
=
(
params
)
=>
postAction
(
prefix
+
"/dept/add"
,
params
);
...
...
src/components/tools/UserMenu.vue
View file @
48f6dc20
...
...
@@ -60,6 +60,12 @@
visible
:
false
}
},
mounted
()
{
let
timestamp
=
(
new
Date
()).
valueOf
();
if
((
timestamp
-
this
.
$store
.
state
.
user
.
info
.
updateTime
)
>
(
24
*
60
*
60
*
1000
*
90
)){
this
.
updatePassword
()
}
},
methods
:
{
...
mapActions
([
"Logout"
]),
...
mapGetters
([
"nickname"
,
"avatar"
,
"userInfo"
]),
...
...
src/components/tools/UserPassword.vue
View file @
48f6dc20
...
...
@@ -10,6 +10,13 @@
>
<a-spin
:spinning=
"confirmLoading"
>
<a-form
:form=
"form"
class=
"addModel clearfix"
>
<a-form-item
v-show=
"tishi"
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"提示:"
>
<p
style=
"color:red;"
>
您的密码已90天未修改,请修改密码后重新登录
</p>
</a-form-item>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
...
...
@@ -20,6 +27,23 @@
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"验证码"
>
<a-input
v-decorator=
"['inputCode',validatorRules.inputCode]"
type=
"text"
placeholder=
"请输入验证码"
>
</a-input>
<a-button
type=
"primary"
htmlType=
"submit"
@
click
.
stop
.
prevent=
"getCode"
>
{{
codeMsg
}}
</a-button>
</a-form-item>
<a-form-item
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
label=
"新密码"
>
<a-input
type=
"password"
placeholder=
"请输入新密码"
v-decorator=
"[ 'newPwd', validatorRules.newPwd]"
/>
</a-form-item>
...
...
@@ -36,17 +60,19 @@
</
template
>
<
script
>
import
{
registercode
}
from
'@/api/system'
import
{
postAction
}
from
'@/api/manage'
import
{
mapActions
}
from
'vuex'
export
default
{
name
:
"UserPassword"
,
data
()
{
return
{
tishi
:
false
,
countdown
:
60
,
// 倒计时秒数
codeMsg
:
'获取验证码'
,
// 按钮上的文字
timer
:
null
,
// 定时器
title
:
"修改密码"
,
modalWidth
:
5
00
,
modalWidth
:
6
00
,
visible
:
false
,
confirmLoading
:
false
,
verifiedCode
:
""
,
...
...
@@ -90,6 +116,36 @@
}
},
methods
:
{
...
mapActions
([
"Logout"
]),
getCode
()
{
// 验证码60秒倒计时
if
(
!
this
.
timer
)
{
postAction
(
this
.
codeurl
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
){
this
.
$notification
.
success
({
message
:
res
.
data
,
});
return
null
;
}
this
.
$notification
.
error
({
message
:
res
.
data
,
});
})
this
.
timer
=
setInterval
(()
=>
{
if
(
this
.
countdown
>
0
&&
this
.
countdown
<=
60
)
{
this
.
countdown
--
;
if
(
this
.
countdown
!==
0
)
{
this
.
codeMsg
=
"重新发送("
+
this
.
countdown
+
")"
;
}
else
{
clearInterval
(
this
.
timer
);
this
.
codeMsg
=
"获取验证码"
;
this
.
countdown
=
60
;
this
.
timer
=
null
;
}
}
},
1000
)
}
},
//密码加密
getPass
(
text
){
/*let keyss = setMaxDigits(130);
...
...
@@ -103,6 +159,10 @@
//return text;
},
show
(
uname
){
let
timestamp
=
(
new
Date
()).
valueOf
();
if
((
timestamp
-
this
.
$store
.
state
.
user
.
info
.
updateTime
)
>
(
24
*
60
*
60
*
1000
*
90
)){
this
.
tishi
=
true
}
if
(
!
uname
){
this
.
$message
.
warning
(
"当前系统无登陆用户!"
);
return
...
...
@@ -113,7 +173,20 @@
}
},
handleCancel
()
{
this
.
close
()
if
(
this
.
tishi
){
this
.
$message
.
warning
(
"您的密码已90天未修改,请修改密码后重新登录!"
);
return
this
.
Logout
({}).
then
(()
=>
{
window
.
location
.
href
=
"/"
;
//window.location.reload()
}).
catch
(
err
=>
{
this
.
$message
.
error
({
title
:
'错误'
,
description
:
err
.
message
})
})
}
else
{
this
.
close
()
}
},
close
()
{
this
.
$emit
(
'close'
);
...
...
@@ -134,15 +207,29 @@
that
.
confirmLoading
=
true
;
values
.
oldPwd
=
encodeURIComponent
(
this
.
getPass
(
values
.
oldPwd
))
values
.
newPwd
=
encodeURIComponent
(
this
.
getPass
(
values
.
newPwd
))
values
.
inputCode
=
encodeURIComponent
(
this
.
getPass
(
values
.
inputCode
))
values
.
rePwd
=
values
.
newPwd
let
params
=
Object
.
assign
(
values
)
postAction
(
this
.
url
,
params
).
then
((
res
)
=>
{
if
(
res
.
code
!=
200
){
that
.
$message
.
error
(
res
.
message
);
that
.
close
();
that
.
$message
.
error
(
res
.
data
);
}
else
{
that
.
$message
.
success
(
res
.
message
);
this
.
visible
=
false
that
.
close
();
if
(
this
.
tishi
){
return
this
.
Logout
({}).
then
(()
=>
{
that
.
$message
.
success
(
"修改成功,请重新登录!"
);
window
.
location
.
href
=
"/"
;
//window.location.reload()
}).
catch
(
err
=>
{
that
.
$message
.
error
({
title
:
'错误'
,
description
:
err
.
message
})
})
}
that
.
$message
.
success
(
res
.
message
);
}
}).
finally
(()
=>
{
that
.
confirmLoading
=
false
;
...
...
src/views/school-center/product/product.vue
View file @
48f6dc20
...
...
@@ -237,6 +237,12 @@
modifyfunction
(
data
){
universitySchool
().
then
(
res
=>
{
this
.
universitySchool
=
res
.
data
res
.
data
.
forEach
(
value
=>
{
if
(
data
.
universityId
==
value
.
universityId
){
this
.
chouti
=
value
}
})
console
.
log
(
this
.
universitySchool
)
})
if
(
data
!=
undefined
){
this
.
productIntroduction
=
data
.
productIntroduction
,
...
...
src/views/system/systemUser.vue
View file @
48f6dc20
...
...
@@ -31,8 +31,8 @@
<a-col
:md=
"6"
:sm=
"24"
>
<a-form-item
label=
"使用状态"
>
<a-select
v-model=
"queryParams.status"
placeholder=
"请选择"
default-value=
"
1
"
>
<!--
<a-select-option
value=
"1,2,3"
>
全部
</a-select-option>
--
>
<a-select
v-model=
"queryParams.status"
placeholder=
"请选择"
default-value=
"
0
"
>
<a-select-option
value=
""
>
全部
</a-select-option
>
<a-select-option
value=
"1"
>
正常
</a-select-option>
<a-select-option
value=
"2"
>
冻结
</a-select-option>
<a-select-option
value=
"3"
>
已失效
</a-select-option>
...
...
@@ -89,18 +89,31 @@
</s-table>
<!-- 修改密码 -->
<a-modal
title=
"密码修改"
v-model=
"editpaswordmodel"
@
ok=
"editPassword"
@
cancel=
"editPasswordcancel"
>
<a-form
:form=
"EditPassFrom"
>
<a-form-item
label=
"原密码"
v-if=
"hasOperationPermission(['超级管理员'])"
>
<a-input
placeholder=
"原密码"
type=
"password"
v-model=
"editpasswordfrom.oldPwd"
></a-input>
</a-form-item>
<a-form-item
label=
"新密码"
>
<a-form
:form=
"EditPassFrom"
>
<a-form-item
label=
"用户密码"
>
<a-input
placeholder=
"用户密码"
v-decorator=
"['glyPwd',{rules: [{ required: true, message: '用户密码不能为空!' }]}]"
type=
"password"
></a-input>
</a-form-item>
<a-form-item
label=
"新密码"
>
<a-input
placeholder=
"新密码"
v-decorator=
"['editpassword',{rules: [{ required: true, message: '新密码不能为空!' }]}]"
type=
"password"
></a-input>
</a-form-item>
<a-form-item
label=
"确认密码"
>
<a-input
placeholder=
"确认密码"
v-decorator=
"['editrepassword',{rules: [{ required: true, message: '确认密码不能为空' }, { validator: this.compareToFirstPassword,}]}]"
type=
"password"
></a-input>
</a-form-item>
<a-form-item
label=
"验证码"
>
<a-input
style=
"width:350px;margin-right: 10px"
v-decorator=
"['inputCode',{rules: [{ required: true, message: '验证码不能为空!' }]}]"
type=
"text"
placeholder=
"请输入验证码"
>
</a-input>
<a-button
type=
"primary"
htmlType=
"submit"
@
click
.
stop
.
prevent=
"getCode"
>
{{codeMsg}}
</a-button>
</a-form-item>
</a-form>
</a-modal>
<!-- 添加用户 -->
...
...
@@ -224,6 +237,7 @@ import treeList from '@/components/sysmanage/treeList'
import
treecheck
from
'@/components/sysmanage/treeCheck'
import
JDate
from
'@/components/jeecg/JDate'
import
{
notification
}
from
'ant-design-vue'
import
{
postAction
}
from
'@/api/manage'
import
{
unique
}
from
'@/utils/util'
import
{
getList
,
...
...
@@ -251,15 +265,20 @@ export default {
},
data
()
{
return
{
countdown
:
60
,
// 倒计时秒数
codeMsg
:
'获取验证码'
,
// 按钮上的文字
timer
:
null
,
// 定时器
title
:
"修改密码"
,
EditPassFrom
:
this
.
$form
.
createForm
(
this
,
{
name
:
'modify'
},),
EditPassMess
:
"不能为空!"
,
//修改密码窗口
editpaswordmodel
:
false
,
editpasswordfrom
:{
oldPwd
:
''
,
newPwd
:
""
,
rePwd
:
""
,
changeId
:
""
,
glyPwd
:
''
,
inputCode
:
''
},
settings
:{
y
:
500
,
x
:
2000
},
advanced
:
false
,
//控制菜单展开
...
...
@@ -292,7 +311,7 @@ export default {
//查询条件
queryParams
:
{
account
:
''
,
status
:
"
1
"
,
status
:
""
,
deptid
:
""
,
name
:
""
,
phone
:
""
...
...
@@ -343,10 +362,41 @@ export default {
resetPassw
:
false
,
add_user
:
false
,
Department
:
false
,
reol
:
false
reol
:
false
,
url
:
"auth/ciop/mgr/changeOtherPwd"
,
codeurl
:
"auth/ciop/mgr/codemessage"
,
}
},
methods
:
{
getCode
()
{
// 验证码60秒倒计时
if
(
!
this
.
timer
)
{
postAction
(
this
.
codeurl
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
){
this
.
$notification
.
success
({
message
:
res
.
data
,
});
return
null
;
}
this
.
$notification
.
error
({
message
:
res
.
data
,
});
})
this
.
timer
=
setInterval
(()
=>
{
if
(
this
.
countdown
>
0
&&
this
.
countdown
<=
60
)
{
this
.
countdown
--
;
if
(
this
.
countdown
!==
0
)
{
this
.
codeMsg
=
"重新发送("
+
this
.
countdown
+
")"
;
}
else
{
clearInterval
(
this
.
timer
);
this
.
codeMsg
=
"获取验证码"
;
this
.
countdown
=
60
;
this
.
timer
=
null
;
}
}
},
1000
)
}
},
//密码加密
getPass
(
text
){
/*let keyss = setMaxDigits(130);
...
...
@@ -361,31 +411,37 @@ export default {
},
//提交密码修改
editPassword
()
{
if
(
this
.
hasOperationPermission
([
'超级管理员'
])){
if
(
this
.
editpasswordfrom
.
oldPwd
==
''
||
this
.
editpasswordfrom
.
oldPwd
==
undefined
){
this
.
$message
.
error
(
"请输入原密码
!"
,
5
);
}
}
let
mima
=
(
/^
(?![
A-Za-z
]
+$
)(?![
A-Z
\d]
+$
)(?![
A-Z
\W]
+$
)(?![
a-z
\d]
+$
)(?![
a-z
\W]
+$
)(?![\d\W]
+$
)\S{8,}
$/
);
if
(
mima
.
test
(
this
.
EditPassFrom
.
getFieldValue
(
'editpassword'
))
==
false
){
this
.
$message
.
error
(
"密码强制等级低,必须要数字、小写英文字母、大写英文字母或特殊字符混合组成,长度至少8位
!"
,
5
);
return
}
this
.
EditPassFrom
.
validateFields
(
err
=>
{
if
(
!
err
)
{
this
.
editpasswordfrom
.
newPwd
=
encodeURIComponent
(
this
.
getPass
(
this
.
EditPassFrom
.
getFieldValue
(
'editpassword'
)))
this
.
editpasswordfrom
.
oldPwd
=
encodeURIComponent
(
this
.
getPass
(
this
.
editpasswordfrom
.
oldPwd
))
this
.
editpasswordfrom
.
rePwd
=
this
.
editpasswordfrom
.
newPwd
this
.
editpasswordfrom
.
glyPwd
=
encodeURIComponent
(
this
.
getPass
(
this
.
EditPassFrom
.
getFieldValue
(
'glyPwd'
)))
this
.
editpasswordfrom
.
inputCode
=
encodeURIComponent
(
this
.
getPass
(
this
.
EditPassFrom
.
getFieldValue
(
'inputCode'
)))
changeOtherPwd
(
this
.
editpasswordfrom
).
then
(
res
=>
{
if
(
res
.
state
==
'success'
)
{
this
.
editpasswordfrom
.
oldPwd
=
''
this
.
editpasswordfrom
.
editrepassword
=
''
this
.
editpasswordfrom
.
editpassword
=
''
if
(
res
.
code
==
200
)
{
this
.
EditPassFrom
.
setFieldsValue
({
editpassword
:
""
});
this
.
EditPassFrom
.
setFieldsValue
({
editrepassword
:
""
});
this
.
EditPassFrom
.
setFieldsValue
({
glyPwd
:
""
});
this
.
EditPassFrom
.
setFieldsValue
({
inputCode
:
""
});
if
(
res
.
message
==
undefined
){
this
.
$message
.
success
(
res
.
data
!=
""
?
res
.
data
:
"修改成功"
,
5
);
}
else
{
this
.
$message
.
success
(
res
.
message
!=
""
?
res
.
message
:
"修改成功"
,
5
);
}
this
.
editpaswordmodel
=
false
}
else
{
this
.
editpasswordfrom
.
oldPwd
=
''
this
.
editpasswordfrom
.
editrepassword
=
''
this
.
editpasswordfrom
.
editpassword
=
''
this
.
$message
.
error
(
res
.
msg
!=
""
?
res
.
msg
:
"修改失败"
,
5
);
if
(
res
.
message
==
undefined
){
this
.
$message
.
error
(
res
.
data
!=
""
?
res
.
data
:
"失败修改"
,
5
);
}
else
{
this
.
$message
.
error
(
res
.
message
!=
""
?
res
.
message
:
"失败修改"
,
5
);
}
}
this
.
editpaswordmodel
=
false
})
}
})
...
...
@@ -394,7 +450,9 @@ export default {
this
.
editpaswordmodel
=
false
this
.
EditPassFrom
.
setFieldsValue
({
editpassword
:
''
,
editrepassword
:
''
editrepassword
:
''
,
glyPwd
:
''
,
inputCode
:
''
})
},
compareToFirstPassword
(
rule
,
value
,
callback
)
{
...
...
@@ -585,14 +643,6 @@ export default {
that
.
$refs
.
table
.
refresh
({
search
:
true
})
})
},
hasOperationPermission
(
marks
=
[])
{
for
(
const
index
in
marks
)
{
if
(
this
.
$store
.
state
.
user
.
info
.
role
.
indexOf
(
marks
[
index
])
>
-
1
)
{
return
false
;
}
}
return
true
;
},
updatePassword
(
userid
){
this
.
editpaswordmodel
=
true
this
.
editpasswordfrom
.
changeId
=
userid
;
...
...
src/views/user/Login.vue
View file @
48f6dc20
...
...
@@ -125,6 +125,7 @@ export default {
requiredTwoStepCaptcha
:
false
,
stepCaptchaVisible
:
false
,
form
:
this
.
$form
.
createForm
(
this
),
updateTime
:
''
,
formLogin
:
{
username
:
""
,
password
:
""
,
...
...
@@ -216,7 +217,9 @@ export default {
loginParams
.
remember
=
that
.
formLogin
.
remember
;
loginParams
.
phonecode
=
encodeURIComponent
(
this
.
getPass
(
values
.
phonecode
));
//console.log(loginParams);
that
.
Login
(
loginParams
).
then
(()
=>
{
that
.
Login
(
loginParams
).
then
((
res
)
=>
{
this
.
updateTime
=
res
.
updateTime
console
.
log
(
res
.
updateTime
)
this
.
departConfirm
({});
}).
catch
((
err
)
=>
{
that
.
requestFailed
(
err
);
...
...
src/views/user/register.vue
View file @
48f6dc20
...
...
@@ -99,7 +99,6 @@ import {timeFix} from "@/utils/util"
import
Vue
from
'vue'
import
{
ACCESS_TOKEN
}
from
"@/store/mutation-types"
import
JGraphicCode
from
'@/components/jeecg/JGraphicCode'
import
{
setMaxDigits
,
RSAKeyPair
,
encryptedString
}
from
'@/utils/RSA'
import
{
register
,
registercode
}
from
'@/api/system'
...
...
@@ -165,17 +164,17 @@ export default {
// 验证码60秒倒计时
if
(
!
this
.
timer
)
{
let
data
=
{
account
:
this
.
form
.
getFieldValue
(
"username"
)
username
:
this
.
form
.
getFieldValue
(
"username"
)
}
registercode
(
data
).
then
(
res
=>
{
if
(
res
.
code
==
200
){
this
.
$notification
.
success
({
message
:
res
.
data
,
message
:
res
.
message
,
});
return
null
;
}
this
.
$notification
.
error
({
message
:
res
.
data
,
message
:
res
.
message
,
});
})
this
.
timer
=
setInterval
(()
=>
{
...
...
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