...
|
...
|
@@ -9,8 +9,6 @@ import crypto from 'util/crypto'; |
|
|
export default {
|
|
|
updateUser(Vue, user, purviews) {
|
|
|
Vue.$store.set(Vue.$config.storeKeys.user, crypto.aesEncrypt(user));
|
|
|
Vue.prop('user', user);
|
|
|
Vue.prop('isLogin', true);
|
|
|
Vue.prop('purviews', purviews.deep);
|
|
|
Vue.prop('oriPurviews', purviews.ori);
|
|
|
},
|
...
|
...
|
@@ -47,6 +45,8 @@ 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)
|
...
|
...
|
@@ -80,6 +80,11 @@ export default { |
|
|
return next('/login.html');
|
|
|
}
|
|
|
|
|
|
// 需求修改密码去修改密码
|
|
|
if (Vue.$needUpdate) {
|
|
|
return next('/password.html');
|
|
|
}
|
|
|
|
|
|
return this.checkPurview(Vue, to).then(() => {
|
|
|
return next();
|
|
|
}, () => {
|
...
|
...
|
@@ -122,7 +127,7 @@ export default { |
|
|
return false;
|
|
|
}
|
|
|
if (status === 403) {
|
|
|
Vue.$router.push('/password.html');
|
|
|
Vue.prop('needUpdate', true);
|
|
|
return false;
|
|
|
}
|
|
|
return true;
|
...
|
...
|
|