Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-shop-manage
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
王水玲
7 years ago
Commit
b181e4e707e9a85ff99957300f33fd89aa8997a7
2 parents
7b51503a
b94da631
Merge branch 'feature/safe' of git.yoho.cn:fe/yoho-shop-manage into feature/safe
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
9 deletions
app/pages/common/password.vue
app/plugins/yoho-plugin-auth.js
server/middleware/auth.js
app/pages/common/password.vue
View file @
b181e4e
...
...
@@ -72,7 +72,7 @@ export default {
}).then(ret => {
if (ret.code === 200) {
this.loading = false;
Vue.
prop('needUpdate', void 0
);
Vue.
$store.remove('needUpdate'
);
this.$router.push('/');
} else {
this.loading = false;
...
...
app/plugins/yoho-plugin-auth.js
View file @
b181e4e
...
...
@@ -47,8 +47,6 @@ export default {
if
(
isLogin
&&
user
)
{
try
{
user
=
crypto
.
aesDecrypt
(
user
,
Object
);
Vue
.
prop
(
'user'
,
user
);
Vue
.
prop
(
'isLogin'
,
true
);
return
Promise
.
all
([
this
.
initPurview
(
Vue
,
user
),
this
.
initConfig
(
Vue
)
...
...
@@ -83,7 +81,7 @@ export default {
}
// 需求修改密码去修改密码
if
(
Vue
.
$
needUpdate
)
{
if
(
Vue
.
$
store
.
get
(
'needUpdate'
)
)
{
return
next
(
'/password.html'
);
}
...
...
@@ -129,7 +127,7 @@ export default {
return
false
;
}
if
(
status
===
403
)
{
Vue
.
prop
(
'needUpdate'
,
true
);
Vue
.
$store
.
set
(
'needUpdate'
,
true
);
return
false
;
}
return
true
;
...
...
server/middleware/auth.js
View file @
b181e4e
...
...
@@ -14,10 +14,9 @@ module.exports = (req, res, next) => {
}
});
}
if
(
req
.
session
.
needUpdate
)
{
if
(
req
.
path
===
'/Api/erp/update'
)
{
return
next
();
}
if
(
req
.
session
.
needUpdate
&&
req
.
path
!==
'/Api/erp/getPurview'
&&
req
.
path
!==
'/Api/erp/update'
)
{
return
res
.
status
(
403
).
json
({
code
:
403
,
message
:
'抱歉,您暂未修改密码!'
,
...
...
Please
register
or
login
to post a comment