resetPWD.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. define(function (require) {
  2. return function (context) {
  3. var $dlg, $form, $comb;
  4. return {
  5. xtype: 'dialog',
  6. dialogId: 'updatePwd',
  7. title: '修改密码',
  8. maximizable: false,
  9. $target: $('body'),
  10. width: 620,
  11. height: 400,
  12. onOpen: function () {
  13. $dlg = $(this);
  14. },
  15. center: {
  16. items: {
  17. xtype: 'formgroup',
  18. onRender: function () {
  19. $form = $(this);
  20. },
  21. items: [
  22. [
  23. {name: 'oldPwd', label: '原始密码', span: 2, xtype: 'passwordbox'},
  24. {name: 'newPwd', label: '新密码', span: 2, xtype: 'passwordbox'},
  25. {name: 'rePwd', label: '确认密码', span: 2, xtype: 'passwordbox'},
  26. ]]
  27. }
  28. },
  29. buttons: [
  30. {
  31. text: "提交", iconCls: "fa fa-save", onClick: function () {
  32. $.yvan.ajax({
  33. url: api('/account/resetPwd'),
  34. method: 'post',
  35. data: $form.formGet(),
  36. success: function (data) {
  37. if (data.success === true) {
  38. $dlg.dialog('close');
  39. $.yvan.msg(data.msg, function () {
  40. top.window.location.href = jumpApi(LOGINURL);
  41. });
  42. }
  43. else {
  44. $.yvan.msg(data.message);
  45. }
  46. }
  47. });
  48. }
  49. }, {
  50. text: "关闭", iconCls: "fa fa-times", onClick: function () {
  51. $dlg.dialog('close');
  52. }
  53. }
  54. ]
  55. };
  56. };
  57. });