mooho-base-admin-plus 2.10.62 → 2.10.64
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 +2 -0
- package/package/mooho-base-admin-plus.min.esm.js +8 -6
- package/package/mooho-base-admin-plus.min.js +3 -3
- package/package.json +1 -1
- package/public/setting.js +7 -0
- package/src/api/user.js +10 -3
- package/src/components/view/mixin.js +19 -2
- package/src/components/view/table-filter.vue +0 -1
- package/src/setting.js +2 -0
package/package.json
CHANGED
package/public/setting.js
CHANGED
package/src/api/user.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import request from '../libs/request';
|
|
2
2
|
import encrypt from '../libs/encrypt';
|
|
3
|
+
import Setting from '../setting.js';
|
|
3
4
|
|
|
4
5
|
const res = 'User';
|
|
5
6
|
|
|
@@ -14,7 +15,10 @@ export default {
|
|
|
14
15
|
});
|
|
15
16
|
},
|
|
16
17
|
login(data) {
|
|
17
|
-
|
|
18
|
+
if (Setting.encrypt.passwordEncrypt) {
|
|
19
|
+
data.password = encrypt(data.password);
|
|
20
|
+
}
|
|
21
|
+
|
|
18
22
|
return request({
|
|
19
23
|
url: `api/${res}/login`,
|
|
20
24
|
method: 'post',
|
|
@@ -31,8 +35,11 @@ export default {
|
|
|
31
35
|
});
|
|
32
36
|
},
|
|
33
37
|
updatePassword(data) {
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
if (Setting.encrypt.passwordEncrypt) {
|
|
39
|
+
data.oldPassword = encrypt(data.oldPassword);
|
|
40
|
+
data.newPassword = encrypt(data.newPassword);
|
|
41
|
+
}
|
|
42
|
+
|
|
36
43
|
return request({
|
|
37
44
|
url: `api/${res}/updatePassword`,
|
|
38
45
|
method: 'post',
|
|
@@ -111,6 +111,7 @@ export default {
|
|
|
111
111
|
if (item.defaultValue.startsWith('{today}')) {
|
|
112
112
|
// 当前日期
|
|
113
113
|
let date = new Date();
|
|
114
|
+
date.setHours(0, 0, 0, 0);
|
|
114
115
|
|
|
115
116
|
if (item.defaultValue.indexOf('+') != -1) {
|
|
116
117
|
date.setDate(date.getDate() + parseInt(item.defaultValue.split('+')[1]));
|
|
@@ -118,11 +119,27 @@ export default {
|
|
|
118
119
|
date.setDate(date.getDate() - parseInt(item.defaultValue.split('-')[1]));
|
|
119
120
|
}
|
|
120
121
|
|
|
121
|
-
let
|
|
122
|
-
|
|
122
|
+
let format = 'yyyy-MM-dd HH:mm:ss';
|
|
123
|
+
|
|
124
|
+
if (item.controlType == 'Date') {
|
|
125
|
+
format = 'yyyy-MM-dd';
|
|
126
|
+
} else if (item.controlType == 'Time') {
|
|
127
|
+
format = 'HH:mm:ss';
|
|
128
|
+
} else if (item.controlType == 'DateTime') {
|
|
129
|
+
format = 'yyyy-MM-dd HH:mm:ss';
|
|
130
|
+
} else if (item.controlType == 'Year') {
|
|
131
|
+
format = 'yyyy';
|
|
132
|
+
} else if (item.controlType == 'Month') {
|
|
133
|
+
format = 'yyyy-MM';
|
|
134
|
+
} else {
|
|
135
|
+
format = 'yyyy-MM-dd';
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
setData(data, item, dateFormat(date, format));
|
|
123
139
|
} else if (item.defaultValue.startsWith('{today(')) {
|
|
124
140
|
// 当前日期
|
|
125
141
|
let date = new Date();
|
|
142
|
+
date.setHours(0, 0, 0, 0);
|
|
126
143
|
|
|
127
144
|
if (item.defaultValue.indexOf('+') != -1) {
|
|
128
145
|
date.setDate(date.getDate() + parseInt(item.defaultValue.split('+')[1]));
|
|
@@ -290,7 +290,6 @@
|
|
|
290
290
|
import modelApi from '../../api/model';
|
|
291
291
|
import customModelApi from '../../api/customModel';
|
|
292
292
|
import DialogSelect from '../input/dialog-select.vue';
|
|
293
|
-
import dateFormat from 'date-fns/format';
|
|
294
293
|
|
|
295
294
|
export default {
|
|
296
295
|
mixins: [mixin, mixinPage],
|
package/src/setting.js
CHANGED