imatrix-ui 2.7.91 → 2.7.92
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/lib/super-ui.css +1 -1
- package/lib/super-ui.umd.min.js +5 -5
- package/package.json +1 -1
- package/src/store/modules/user.js +5 -1
- package/src/styles/index.scss +22 -0
- package/src/utils/auth.js +21 -0
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ssoService from '../../api/sso-service'
|
|
2
|
-
import { setToken, removeToken, setUsername, getUsername, removeUsername } from '../../utils/auth'
|
|
2
|
+
import { setToken, removeToken, setUsername, getUsername, removeUsername, setCurrentUser, removeCurrentUser } from '../../utils/auth'
|
|
3
3
|
|
|
4
4
|
import { removePermissions, getPermissions, setPermissions, getMenus, setMenus, removeMenus } from '../../utils/permissionAuth'
|
|
5
5
|
|
|
@@ -68,9 +68,11 @@ const user = {
|
|
|
68
68
|
ssoService.getCurrentUser().then(user => {
|
|
69
69
|
if (user) {
|
|
70
70
|
setUsername(user.loginName)
|
|
71
|
+
setCurrentUser(user)
|
|
71
72
|
commit('setName', user.name)
|
|
72
73
|
} else {
|
|
73
74
|
removeUsername()
|
|
75
|
+
removeCurrentUser()
|
|
74
76
|
commit('setName', '')
|
|
75
77
|
}
|
|
76
78
|
// commit('SET_AVATAR', data.avatar)
|
|
@@ -94,6 +96,7 @@ const user = {
|
|
|
94
96
|
|
|
95
97
|
commit('setName', '')
|
|
96
98
|
removeUsername()
|
|
99
|
+
removeCurrentUser()
|
|
97
100
|
|
|
98
101
|
removePermissions()
|
|
99
102
|
|
|
@@ -114,6 +117,7 @@ const user = {
|
|
|
114
117
|
|
|
115
118
|
commit('setName', '')
|
|
116
119
|
removeUsername()
|
|
120
|
+
removeCurrentUser()
|
|
117
121
|
|
|
118
122
|
removePermissions()
|
|
119
123
|
|
package/src/styles/index.scss
CHANGED
|
@@ -31,4 +31,26 @@ body .el-table th.gutter {
|
|
|
31
31
|
|
|
32
32
|
body .el-table colgroup.gutter {
|
|
33
33
|
display: table-cell !important;
|
|
34
|
+
}
|
|
35
|
+
// 日期控件宽度不自适应问题
|
|
36
|
+
.formContent .el-date-editor.el-input,.formContent .el-date-editor.el-input__input,.formContent .el-date-editor.el-input__inner,
|
|
37
|
+
.grid-search-form .el-date-editor.el-input,.grid-search-form .el-date-editor.el-input__input,.grid-search-form .el-date-editor.el-input__inner {
|
|
38
|
+
width: 100%;
|
|
39
|
+
}
|
|
40
|
+
.formContent .el-date-editor--daterange.el-input,.formContent .el-date-editor--daterange.el-input__inner,.formContent .el-date-editor--timerange.el-input,.formContent .el-date-editor--timerange.el-input__inner,
|
|
41
|
+
.grid-search-form .el-date-editor--daterange.el-input,.grid-search-form .el-date-editor--daterange.el-input__inner,.grid-search-form .el-date-editor--timerange.el-input,.grid-search-form .el-date-editor--timerange.el-input__inner {
|
|
42
|
+
width: 100%;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// 显示必填标志
|
|
46
|
+
.is_req {
|
|
47
|
+
.required__label::before {
|
|
48
|
+
content: '*';
|
|
49
|
+
color: #f56c6c;
|
|
50
|
+
margin-right: 4px;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.formContent .el-form-item {
|
|
55
|
+
margin-bottom: 0;
|
|
34
56
|
}
|
package/src/utils/auth.js
CHANGED
|
@@ -4,6 +4,7 @@ import Vue from 'vue'
|
|
|
4
4
|
|
|
5
5
|
const jwtKey = 'JWT'
|
|
6
6
|
const currentUserNameKey = 'USERNAME'
|
|
7
|
+
const currentUserInfoKey = 'CURRENT_USER'
|
|
7
8
|
|
|
8
9
|
export function getToken() {
|
|
9
10
|
let jwt = sessionStorage.getItem(jwtKey)
|
|
@@ -46,3 +47,23 @@ export function setUsername(username) {
|
|
|
46
47
|
export function removeUsername() {
|
|
47
48
|
sessionStorage.removeItem(currentUserNameKey)
|
|
48
49
|
}
|
|
50
|
+
|
|
51
|
+
export function getCurrentUser() {
|
|
52
|
+
const userJson = sessionStorage.getItem(currentUserInfoKey)
|
|
53
|
+
if (userJson) {
|
|
54
|
+
return JSON.parse(userJson)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function setCurrentUser(userInfo) {
|
|
59
|
+
if (userInfo) {
|
|
60
|
+
if (userInfo.password) {
|
|
61
|
+
userInfo.password = null
|
|
62
|
+
}
|
|
63
|
+
sessionStorage.setItem(currentUserInfoKey, JSON.stringify(userInfo))
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function removeCurrentUser() {
|
|
68
|
+
sessionStorage.removeItem(currentUserInfoKey)
|
|
69
|
+
}
|