mooho-base-admin-plus 2.8.26 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/history.md +1 -0
- package/package/mooho-base-admin-plus.min.esm.js +34 -18
- package/package/mooho-base-admin-plus.min.js +3 -3
- package/package/style.css +1 -1
- package/package.json +1 -1
- package/src/layouts/basic-layout/header-user/index.vue +10 -1
- package/src/store/modules/admin/modules/account.js +19 -3
- package/src/store/modules/admin/modules/user.js +2 -0
package/package.json
CHANGED
|
@@ -113,9 +113,18 @@
|
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
115
|
},
|
|
116
|
+
watch: {
|
|
117
|
+
openPassword(newValue, oldValue) {
|
|
118
|
+
if (newValue == true) {
|
|
119
|
+
this.resetPwdOpen();
|
|
120
|
+
this.openPassword = false;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
116
124
|
computed: {
|
|
117
125
|
...mapState('admin/user', ['info']),
|
|
118
|
-
...mapState('admin/layout', ['isMobile', 'logoutConfirm'])
|
|
126
|
+
...mapState('admin/layout', ['isMobile', 'logoutConfirm']),
|
|
127
|
+
...mapState('admin/account', ['openPassword'])
|
|
119
128
|
},
|
|
120
129
|
methods: {
|
|
121
130
|
...mapActions('admin/account', ['logout']),
|
|
@@ -9,6 +9,10 @@ import Setting from '../../../../setting';
|
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
11
|
namespaced: true,
|
|
12
|
+
state: {
|
|
13
|
+
// 弹出密码修改框
|
|
14
|
+
openPassword: false
|
|
15
|
+
},
|
|
12
16
|
actions: {
|
|
13
17
|
/**
|
|
14
18
|
* @description 登录
|
|
@@ -27,7 +31,7 @@ export default {
|
|
|
27
31
|
* @param token {String} 令牌
|
|
28
32
|
* @param data {String} 数据
|
|
29
33
|
*/
|
|
30
|
-
async saveLoginData({ dispatch }, { user, token, data } = {}) {
|
|
34
|
+
async saveLoginData({ state, dispatch }, { user, token, data, passwordExpire } = {}) {
|
|
31
35
|
// 设置 cookie 一定要存 uuid 和 token 两个 cookie
|
|
32
36
|
// 整个系统依赖这两个数据进行校验和存储
|
|
33
37
|
// uuid 是用户身份唯一标识 用户注册的时候确定 并且不可改变 不可重复
|
|
@@ -45,17 +49,29 @@ export default {
|
|
|
45
49
|
|
|
46
50
|
// 用户登录后从持久化数据加载一系列的设置
|
|
47
51
|
await dispatch('load', { loadOpenedTabs: Setting.page.loadOpenedTabs });
|
|
52
|
+
|
|
53
|
+
if (passwordExpire < 0) {
|
|
54
|
+
swal
|
|
55
|
+
.fire({
|
|
56
|
+
title: window.$app.$t('Front_Msg_Password_Expire'),
|
|
57
|
+
icon: 'warning',
|
|
58
|
+
confirmButtonText: window.$app.$t('Front_Btn_OK')
|
|
59
|
+
})
|
|
60
|
+
.then(() => {
|
|
61
|
+
state.openPassword = true;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
48
64
|
},
|
|
49
65
|
/**
|
|
50
66
|
* @description 退出登录
|
|
51
67
|
* */
|
|
52
68
|
logout({ dispatch }, { confirm = false } = {}) {
|
|
53
69
|
async function logout() {
|
|
70
|
+
// 清空 vuex 用户信息
|
|
71
|
+
await dispatch('admin/user/set', {}, { root: true });
|
|
54
72
|
// 删除cookie
|
|
55
73
|
util.cookies.remove('token');
|
|
56
74
|
util.cookies.remove('uuid');
|
|
57
|
-
// 清空 vuex 用户信息
|
|
58
|
-
await dispatch('admin/user/set', {}, { root: true });
|
|
59
75
|
// 跳转路由
|
|
60
76
|
if (router.currentRoute.value.path != '/login') {
|
|
61
77
|
router.push('/login?redirect=' + router.options.history.location);
|