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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mooho-base-admin-plus",
3
3
  "description": "MOOHO basic framework for admin by Vue3",
4
- "version": "2.10.62",
4
+ "version": "2.10.64",
5
5
  "author": "jinyifan <jinyifan@mooho.com.cn>",
6
6
  "license": "MIT",
7
7
  "private": false,
package/public/setting.js CHANGED
@@ -96,5 +96,12 @@ window.setting = {
96
96
  auto: true,
97
97
  // 切换语言时是否刷新页面
98
98
  refresh: true
99
+ },
100
+ /**
101
+ * 加密配置
102
+ * */
103
+ encrypt: {
104
+ // 是否开启密码加密,开启后,登录、修改密码等操作,都需要进行密码加密处理
105
+ passwordEncrypt: false
99
106
  }
100
107
  };
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
- data.password = encrypt(data.password);
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
- data.oldPassword = encrypt(data.oldPassword);
35
- data.newPassword = encrypt(data.newPassword);
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 value = date.toISOString().replace(/T.*/, '');
122
- setData(data, item, new Date(value));
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
@@ -189,6 +189,8 @@ const Setting = {
189
189
  * 加密配置
190
190
  * */
191
191
  encrypt: {
192
+ // 是否开启密码加密,开启后,登录、修改密码等操作,都需要进行密码加密处理
193
+ passwordEncrypt: true,
192
194
  // 公钥
193
195
  publicKey: `-----BEGIN PUBLIC KEY-----
194
196
  MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6q617CxtIUoK2qzxUFDpzpLnx