eoss-ui 0.5.23 → 0.5.24

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.
Files changed (47) hide show
  1. package/lib/button-group.js +55 -53
  2. package/lib/button.js +55 -53
  3. package/lib/checkbox-group.js +55 -53
  4. package/lib/config/api.js +1 -0
  5. package/lib/data-table-form.js +55 -53
  6. package/lib/data-table.js +55 -53
  7. package/lib/date-picker.js +55 -53
  8. package/lib/dialog.js +55 -53
  9. package/lib/eoss-ui.common.js +489 -216
  10. package/lib/flow-group.js +55 -53
  11. package/lib/flow-list.js +58 -56
  12. package/lib/flow.js +77 -75
  13. package/lib/form.js +55 -53
  14. package/lib/handle-user.js +56 -54
  15. package/lib/handler.js +56 -54
  16. package/lib/index.js +1 -1
  17. package/lib/input-number.js +55 -53
  18. package/lib/input.js +55 -53
  19. package/lib/login.js +435 -162
  20. package/lib/main.js +64 -62
  21. package/lib/nav.js +55 -53
  22. package/lib/notify.js +60 -58
  23. package/lib/page.js +55 -53
  24. package/lib/player.js +55 -53
  25. package/lib/qr-code.js +55 -53
  26. package/lib/radio-group.js +55 -53
  27. package/lib/retrial-auth.js +56 -54
  28. package/lib/select-ganged.js +55 -53
  29. package/lib/select.js +55 -53
  30. package/lib/selector-panel.js +55 -53
  31. package/lib/selector.js +55 -53
  32. package/lib/sizer.js +55 -53
  33. package/lib/steps.js +55 -53
  34. package/lib/switch.js +55 -53
  35. package/lib/table-form.js +55 -53
  36. package/lib/tabs.js +55 -53
  37. package/lib/tips.js +55 -53
  38. package/lib/tree-group.js +55 -53
  39. package/lib/tree.js +55 -53
  40. package/lib/upload.js +61 -59
  41. package/lib/wujie.js +55 -53
  42. package/lib/wxlogin.js +55 -53
  43. package/package.json +1 -1
  44. package/packages/login/src/main.vue +4 -0
  45. package/packages/login/src/resetPassword.vue +413 -95
  46. package/src/config/api.js +1 -0
  47. package/src/index.js +1 -1
@@ -16,6 +16,7 @@
16
16
  >
17
17
  <el-menu-item index="6">短信验证</el-menu-item>
18
18
  <el-menu-item index="11">邮箱验证</el-menu-item>
19
+ <el-menu-item index="0" v-if="this.operationCheckCode">原密码验证</el-menu-item>
19
20
  </el-menu>
20
21
  <es-form
21
22
  ref="pwdForm"
@@ -36,7 +37,8 @@
36
37
  import {
37
38
  initModifyPassword,
38
39
  getModifyPassCode,
39
- codeModifyPass
40
+ codeModifyPass,
41
+ loginModifyPassword
40
42
  } from 'eoss-ui/src/config/api.js';
41
43
  import rules from 'eoss-ui/src/utils/rules.js';
42
44
  import util from 'eoss-ui/src/utils/util';
@@ -45,13 +47,16 @@ export default {
45
47
  props: {
46
48
  secret: String,
47
49
  isEncrypt: Boolean,
48
- type: String
50
+ type: String,
51
+ operationCheckCode: String,
52
+ username: String
49
53
  },
50
54
  computed: {
51
55
  page() {
52
- return [
53
- this.activeIndex == '6'
54
- ? {
56
+ switch (this.activeIndex) {
57
+ case '6':
58
+ return [
59
+ {
55
60
  type: 'text',
56
61
  name: 'target',
57
62
  label: '手机号',
@@ -67,8 +72,86 @@ export default {
67
72
  trigger: 'blur'
68
73
  }
69
74
  ]
75
+ },
76
+ {
77
+ type: 'password',
78
+ name: 'password',
79
+ label: '新密码',
80
+ placeholder: '请输入新密码',
81
+ showPassword: true,
82
+ rules: [
83
+ this.checkPassword
84
+ ? {
85
+ pattern: this.checkPassword,
86
+ message: this.checkPasswordMsg
87
+ ? this.checkPasswordMsg
88
+ : '密码格式不合法',
89
+ trigger: 'blur'
90
+ }
91
+ : {},
92
+ {
93
+ required: true,
94
+ message: '请输入新密码',
95
+ trigger: 'blur'
96
+ }
97
+ ]
98
+ },
99
+ {
100
+ type: 'password',
101
+ name: 'repassword',
102
+ placeholder: '请确认新密码',
103
+ label: '确认新密码',
104
+ showPassword: true,
105
+ rules: [
106
+ this.checkPassword
107
+ ? {
108
+ pattern: this.checkPassword,
109
+ message: this.checkPasswordMsg
110
+ ? this.checkPasswordMsg
111
+ : '密码格式不合法',
112
+ trigger: 'blur'
113
+ }
114
+ : {},
115
+ {
116
+ required: true,
117
+ message: '请输入新密码',
118
+ trigger: 'blur'
119
+ },
120
+ { validator: this.reregExpValidate, trigger: 'blur' }
121
+ ]
122
+ },
123
+ {
124
+ type: 'text',
125
+ name: 'verificationCode',
126
+ placeholder: '请输入验证码',
127
+ label: '验证码',
128
+ append: {
129
+ text: this.btnText,
130
+ attrs: { disabled: this.disabled },
131
+ event: this.getVerificationCode
132
+ },
133
+ rules: [
134
+ {
135
+ required: true,
136
+ message: '请输入验证码',
137
+ trigger: 'blur'
138
+ }
139
+ ]
140
+ },
141
+ {
142
+ type: 'submit',
143
+ contents: [
144
+ {
145
+ type: 'primary',
146
+ text: '提交',
147
+ event: 'confirm'
148
+ }
149
+ ]
70
150
  }
71
- : {
151
+ ];
152
+ case '11':
153
+ return [
154
+ {
72
155
  type: 'text',
73
156
  name: 'target',
74
157
  label: '邮箱地址',
@@ -86,82 +169,288 @@ export default {
86
169
  }
87
170
  ]
88
171
  },
89
- {
90
- type: 'password',
91
- name: 'password',
92
- label: '新密码',
93
- placeholder: '请输入新密码',
94
- showPassword: true,
95
- rules: [
96
- this.checkPassword
97
- ? {
98
- pattern: this.checkPassword,
99
- message: this.checkPasswordMsg
100
- ? this.checkPasswordMsg
101
- : '密码格式不合法',
172
+ {
173
+ type: 'password',
174
+ name: 'password',
175
+ label: '新密码',
176
+ placeholder: '请输入新密码',
177
+ showPassword: true,
178
+ rules: [
179
+ this.checkPassword
180
+ ? {
181
+ pattern: this.checkPassword,
182
+ message: this.checkPasswordMsg
183
+ ? this.checkPasswordMsg
184
+ : '密码格式不合法',
185
+ trigger: 'blur'
186
+ }
187
+ : {},
188
+ {
189
+ required: true,
190
+ message: '请输入新密码',
102
191
  trigger: 'blur'
103
192
  }
104
- : {},
193
+ ]
194
+ },
105
195
  {
106
- required: true,
107
- message: '请输入新密码',
108
- trigger: 'blur'
196
+ type: 'password',
197
+ name: 'repassword',
198
+ placeholder: '请确认新密码',
199
+ label: '确认新密码',
200
+ showPassword: true,
201
+ rules: [
202
+ this.checkPassword
203
+ ? {
204
+ pattern: this.checkPassword,
205
+ message: this.checkPasswordMsg
206
+ ? this.checkPasswordMsg
207
+ : '密码格式不合法',
208
+ trigger: 'blur'
209
+ }
210
+ : {},
211
+ {
212
+ required: true,
213
+ message: '请输入新密码',
214
+ trigger: 'blur'
215
+ },
216
+ { validator: this.reregExpValidate, trigger: 'blur' }
217
+ ]
218
+ },
219
+ {
220
+ type: 'text',
221
+ name: 'verificationCode',
222
+ placeholder: '请输入验证码',
223
+ label: '验证码',
224
+ append: {
225
+ text: this.btnText,
226
+ attrs: { disabled: this.disabled },
227
+ event: this.getVerificationCode
228
+ },
229
+ rules: [
230
+ {
231
+ required: true,
232
+ message: '请输入验证码',
233
+ trigger: 'blur'
234
+ }
235
+ ]
236
+ },
237
+ {
238
+ type: 'submit',
239
+ contents: [
240
+ {
241
+ type: 'primary',
242
+ text: '提交',
243
+ event: 'confirm'
244
+ }
245
+ ]
109
246
  }
110
- ]
111
- },
112
- {
113
- type: 'password',
114
- name: 'repassword',
115
- placeholder: '请确认新密码',
116
- label: '确认新密码',
117
- showPassword: true,
118
- rules: [
119
- this.checkPassword
120
- ? {
121
- pattern: this.checkPassword,
122
- message: this.checkPasswordMsg
123
- ? this.checkPasswordMsg
124
- : '密码格式不合法',
247
+ ];
248
+ case '0':
249
+ this.$set(
250
+ this.formData,
251
+ 'username',
252
+ this.username ? this.username : ''
253
+ );
254
+ return [
255
+ {
256
+ type: 'text',
257
+ name: 'userName',
258
+ label: '用户名',
259
+ placeholder: '请输入用户名',
260
+ rules: [
261
+ {
262
+ required: true,
263
+ message: '请输入用户名',
125
264
  trigger: 'blur'
126
265
  }
127
- : {},
266
+ ]
267
+ },
128
268
  {
129
- required: true,
130
- message: '请输入新密码',
131
- trigger: 'blur'
269
+ type: 'password',
270
+ name: 'oldPassword',
271
+ label: '旧密码',
272
+ placeholder: '请输入旧密码',
273
+ showPassword: true,
274
+ rules: [
275
+ {
276
+ required: true,
277
+ message: '请输入旧密码',
278
+ trigger: 'blur'
279
+ }
280
+ ]
132
281
  },
133
- { validator: this.reregExpValidate, trigger: 'blur' }
134
- ]
135
- },
136
- {
137
- type: 'text',
138
- name: 'verificationCode',
139
- placeholder: '请输入验证码',
140
- label: '验证码',
141
- append: {
142
- text: this.btnText,
143
- attrs: { disabled: this.disabled },
144
- event: this.getVerificationCode
145
- },
146
- rules: [
147
282
  {
148
- required: true,
149
- message: '请输入验证码',
150
- trigger: 'blur'
151
- }
152
- ]
153
- },
154
- {
155
- type: 'submit',
156
- contents: [
283
+ type: 'password',
284
+ name: 'password',
285
+ label: '新密码',
286
+ placeholder: '请输入新密码',
287
+ showPassword: true,
288
+ rules: [
289
+ this.checkPassword
290
+ ? {
291
+ pattern: this.checkPassword,
292
+ message: this.checkPasswordMsg
293
+ ? this.checkPasswordMsg
294
+ : '密码格式不合法',
295
+ trigger: 'blur'
296
+ }
297
+ : {},
298
+ {
299
+ required: true,
300
+ message: '请输入新密码',
301
+ trigger: 'blur'
302
+ }
303
+ ]
304
+ },
305
+ {
306
+ type: 'password',
307
+ name: 'repassword',
308
+ placeholder: '请确认新密码',
309
+ label: '确认新密码',
310
+ showPassword: true,
311
+ rules: [
312
+ this.checkPassword
313
+ ? {
314
+ pattern: this.checkPassword,
315
+ message: this.checkPasswordMsg
316
+ ? this.checkPasswordMsg
317
+ : '密码格式不合法',
318
+ trigger: 'blur'
319
+ }
320
+ : {},
321
+ {
322
+ required: true,
323
+ message: '请输入新密码',
324
+ trigger: 'blur'
325
+ },
326
+ { validator: this.reregExpValidate, trigger: 'blur' }
327
+ ]
328
+ },
157
329
  {
158
- type: 'primary',
159
- text: '提交',
160
- event: 'confirm'
330
+ type: 'submit',
331
+ contents: [
332
+ {
333
+ type: 'primary',
334
+ text: '提交',
335
+ event: 'confirm'
336
+ }
337
+ ]
161
338
  }
162
- ]
163
- }
164
- ];
339
+ ];
340
+ }
341
+ // return [
342
+ // this.activeIndex == '6'
343
+ // ? {
344
+ // type: 'text',
345
+ // name: 'target',
346
+ // label: '手机号',
347
+ // placeholder: '请输入手机号',
348
+ // rules: [
349
+ // {
350
+ // required: true,
351
+ // message: '请输入手机号',
352
+ // trigger: 'blur'
353
+ // },
354
+ // {
355
+ // ...rules.phone,
356
+ // trigger: 'blur'
357
+ // }
358
+ // ]
359
+ // }
360
+ // : {
361
+ // type: 'text',
362
+ // name: 'target',
363
+ // label: '邮箱地址',
364
+ // placeholder: '请输入邮箱地址',
365
+ // rules: [
366
+ // {
367
+ // required: true,
368
+ // message: '请输入邮箱地址',
369
+ // trigger: 'blur'
370
+ // },
371
+ // {
372
+ // type: 'email',
373
+ // message: '请输入正确的邮箱地址',
374
+ // trigger: 'blur'
375
+ // }
376
+ // ]
377
+ // },
378
+ // {
379
+ // type: 'password',
380
+ // name: 'password',
381
+ // label: '新密码',
382
+ // placeholder: '请输入新密码',
383
+ // showPassword: true,
384
+ // rules: [
385
+ // this.checkPassword
386
+ // ? {
387
+ // pattern: this.checkPassword,
388
+ // message: this.checkPasswordMsg
389
+ // ? this.checkPasswordMsg
390
+ // : '密码格式不合法',
391
+ // trigger: 'blur'
392
+ // }
393
+ // : {},
394
+ // {
395
+ // required: true,
396
+ // message: '请输入新密码',
397
+ // trigger: 'blur'
398
+ // }
399
+ // ]
400
+ // },
401
+ // {
402
+ // type: 'password',
403
+ // name: 'repassword',
404
+ // placeholder: '请确认新密码',
405
+ // label: '确认新密码',
406
+ // showPassword: true,
407
+ // rules: [
408
+ // this.checkPassword
409
+ // ? {
410
+ // pattern: this.checkPassword,
411
+ // message: this.checkPasswordMsg
412
+ // ? this.checkPasswordMsg
413
+ // : '密码格式不合法',
414
+ // trigger: 'blur'
415
+ // }
416
+ // : {},
417
+ // {
418
+ // required: true,
419
+ // message: '请输入新密码',
420
+ // trigger: 'blur'
421
+ // },
422
+ // { validator: this.reregExpValidate, trigger: 'blur' }
423
+ // ]
424
+ // },
425
+ // {
426
+ // type: 'text',
427
+ // name: 'verificationCode',
428
+ // placeholder: '请输入验证码',
429
+ // label: '验证码',
430
+ // append: {
431
+ // text: this.btnText,
432
+ // attrs: { disabled: this.disabled },
433
+ // event: this.getVerificationCode
434
+ // },
435
+ // rules: [
436
+ // {
437
+ // required: true,
438
+ // message: '请输入验证码',
439
+ // trigger: 'blur'
440
+ // }
441
+ // ]
442
+ // },
443
+ // {
444
+ // type: 'submit',
445
+ // contents: [
446
+ // {
447
+ // type: 'primary',
448
+ // text: '提交',
449
+ // event: 'confirm'
450
+ // }
451
+ // ]
452
+ // }
453
+ // ];
165
454
  },
166
455
  show() {
167
456
  if (this.type) {
@@ -298,33 +587,62 @@ export default {
298
587
  data: data.password,
299
588
  key: this.secret
300
589
  });
590
+ data.oldPassword = util.esmEncrypt({
591
+ data: data.oldPassword,
592
+ key: this.secret
593
+ });
301
594
  }
302
- if (this.activeIndex == '6') {
303
- data.targetType = 'SMS';
595
+ if (this.activeIndex == '0') {
596
+ data.operationCheckCode = this.operationCheckCode;
597
+ util
598
+ .ajax({
599
+ method: 'post',
600
+ url: loginModifyPassword,
601
+ data: data
602
+ })
603
+ .then((res) => {
604
+ this.submit = false;
605
+ if (res.rCode === 0) {
606
+ this.$message.success(res.msg);
607
+ this.$emit('success');
608
+ } else {
609
+ let msg = res.msg || '系统错误,请联系管理员!';
610
+ this.$message.error(msg);
611
+ }
612
+ })
613
+ .catch((err) => {
614
+ if (err.message && err.message !== 'canceled') {
615
+ this.$message.error(err.message);
616
+ }
617
+ });
304
618
  } else {
305
- data.targetType = 'EMAIL';
619
+ if (this.activeIndex == '6') {
620
+ data.targetType = 'SMS';
621
+ } else {
622
+ data.targetType = 'EMAIL';
623
+ }
624
+ util
625
+ .ajax({
626
+ method: 'post',
627
+ url: codeModifyPass,
628
+ data: data
629
+ })
630
+ .then((res) => {
631
+ this.submit = false;
632
+ if (res.rCode === 0) {
633
+ this.$message.success(res.msg);
634
+ this.$emit('success');
635
+ } else {
636
+ let msg = res.msg || '系统错误,请联系管理员!';
637
+ this.$message.error(msg);
638
+ }
639
+ })
640
+ .catch((err) => {
641
+ if (err.message && err.message !== 'canceled') {
642
+ this.$message.error(err.message);
643
+ }
644
+ });
306
645
  }
307
- util
308
- .ajax({
309
- method: 'post',
310
- url: codeModifyPass,
311
- data: data
312
- })
313
- .then((res) => {
314
- this.submit = false;
315
- if (res.rCode === 0) {
316
- this.$message.success(res.msg);
317
- this.$emit('success');
318
- } else {
319
- let msg = res.msg || '系统错误,请联系管理员!';
320
- this.$message.error(msg);
321
- }
322
- })
323
- .catch((err) => {
324
- if (err.message && err.message !== 'canceled') {
325
- this.$message.error(err.message);
326
- }
327
- });
328
646
  },
329
647
  handleSelect(res) {
330
648
  this.$refs.pwdForm.resetFields();
package/src/config/api.js CHANGED
@@ -12,6 +12,7 @@ export const updateCode =
12
12
  '/sso2/signIn/assembly/getSmsModifyPassVerificationCode'; // 获取短信验证码(修改密码)
13
13
  export const getModifyPassCode = '/sso2/signIn/assembly/getModifyPassCode'; // 获取修改密码的短信、邮箱验证码
14
14
  export const codeModifyPass = '/sso2/signIn/assembly/codeModifyPass'; // 验证码重置密码
15
+ export const loginModifyPassword = '/sso2/signIn/auth/loginModifyPassword'; // 原始密码重置密码
15
16
  export const authCenter = '/sso2/authCenter/login'; // 单点登录认证中心
16
17
  export const initModifyPassword = '/sso2/signIn/assembly/initModifyPassword'; // 初始化密码修改信息
17
18
  export const doWechatQrLogin = '/sso2/signIn/auth/doWechatQrLogin'; // 微信扫码登录
package/src/index.js CHANGED
@@ -117,7 +117,7 @@ if (typeof window !== 'undefined' && window.Vue) {
117
117
  }
118
118
 
119
119
  export default {
120
- version: '0.5.23',
120
+ version: '0.5.24',
121
121
  install,
122
122
  Button,
123
123
  ButtonGroup,