{"title":"登录","inframe":false,"hidden":false,"roles":{"default":1},"pageLink":"","children":[{"configs":{"loginRequired":"false","itemId":"module"},"events":{"initialize":"Wb.apply(app, {\n  changeVC: function() {\n    app.verifyImage.setSrc('m?xwl=sys/session/get-verify-image&' + Wb.getId());\n  },\n  /**\n   * 登录成功后的回调函数。可通过重载该方法来实现执行不同的回调功能。\n   * @param {Object} resp 包含响应数据的XMLHttpRequest对象。\n   */\n  loginSuccess: function(resp) {\n    if (app.saveNameCheck.getValue())\n      Wb.setCookie('sys.username', app.username.getValue());\n    window.location = app.main.referUrl || resp.responseText;\n  },\n  login: function() {\n    if (!Wb.verify(app.main))\n      return;\n    Wb.request({\n      url: 'm?xwl=sys/session/verify',\n      out: app.main,\n      message: Str.processLogin,\n      showError: false,\n      success: app.loginSuccess,\n      failure: function(resp) {\n        if (app.verifyEnabled)\n          app.changeVC();\n        Wb.except(resp, function() {\n          var s = resp.responseText;\n          switch (s) {\n            case Str.vcInvalid:\n            case Str.vcExpired:\n              if (!app.verifyCode.hidden)\n                app.verifyCode.focus(true, true);\n              break;\n            case Str.passwordInvalid:\n              app.password.focus(true, true);\n              break;\n            default:\n              app.username.focus(true, true);\n              break;\n          }\n        });\n      }\n    });\n  },\n  reset: function() {\n    Wb.reset(app.main);\n  }\n});"},"children":[{"configs":{"height":"180","layout":"absolute","width":"448","flat":"true","itemId":"main"},"events":{"afterrender":"var username = Wb.getCookie('sys.username');\nWb.monEnter(panel, function() {\n  app.login();\n});\napp.saveNameCheck.setValue(!!username);\nif (Wb.isEmpty(username)) {\n  //单独timeout防止focus任务被cancel\n  setTimeout(function() {\n    app.username.focus();\n  }, 50);\n} else {\n  app.username.setValue(username);\n  setTimeout(function() {\n    app.password.focus();\n  }, 50);\n}","beforerender":"app.verifyEnabled = '{#Var.sys.session.verifyImage.enabled#}' === 'true';\nif (app.verifyEnabled)\n  app.verifyImage.src = 'm?xwl=sys/session/get-verify-image';\nelse {\n  app.username.y += 10;\n  app.password.y += 20;\n  app.verifyCode.hidden = true;\n  app.verifyImage.hidden = true;\n}"},"children":[{"configs":{"height":"22","allowBlank":"false","width":"296","fieldStyle":"padding-left:28px;background-image:url(wb/images/app/user.gif);background-repeat:no-repeat;background-position:left center;","labelAlign":"right","itemId":"username","fieldLabel":"@Str.username","y":"32","x":"16"},"children":[],"type":"text","expanded":false},{"configs":{"height":"22","allowBlank":"false","width":"296","inputType":"password","fieldStyle":"padding-left:28px;background-image:url(wb/images/app/password.gif);background-repeat:no-repeat;background-position:left center;","labelAlign":"right","itemId":"password","fieldLabel":"@Str.password","y":"64","x":"16"},"children":[],"type":"text","expanded":false},{"configs":{"height":"22","allowBlank":"false","width":"200","fieldStyle":"padding-left:28px;background-image:url(wb/images/app/check.gif);background-repeat:no-repeat;background-position:left center;","labelAlign":"right","itemId":"verifyCode","fieldLabel":"@Str.verifyCode","y":"96","x":"16"},"children":[],"type":"text","expanded":false},{"configs":{"title":"@Str.clickChangeVC","height":"20","style":"cursor:pointer;","alt":"@Str.verifyCode","width":"90","itemId":"verifyImage","y":"97","x":"222"},"events":{"click":"app.changeVC();\napp.verifyCode.focus(true, true);"},"children":[],"type":"image","expanded":false},{"configs":{"height":"124","width":"100","stretch":"false","src":"wb/images/app/login.gif","itemId":"iconImage","y":"20","x":"328"},"children":[],"type":"image","expanded":false},{"configs":{"height":"22","width":"192","itemId":"saveNameCheck","boxLabel":"@Str.saveUserName","y":"128","x":"120"},"events":{"change":"if (!newValue)\n  Ext.util.Cookies.clear('sys.username');"},"children":[],"type":"check","expanded":false}],"type":"panel","expanded":true}],"type":"module","expanded":true}],"iconCls":""}