{"hidden":false,"children":[{"configs":{"itemId":"module","title":"{#Str.login#}","loginRequired":"false"},"expanded":true,"children":[{"configs":{"itemId":"win","fullscreen":"true","scrollable":"true"},"expanded":true,"children":[{"configs":{"itemId":"titlebar1","title":"{#Var.sys.app.title#}","docked":"top","titleAlign":"left"},"expanded":true,"children":[{"configs":{"itemId":"loginBtn","handler":"app.login","glyph":"f007","ui":"action","text":"@Str.login","align":"right"},"expanded":false,"children":[],"type":"tbutton"}],"type":"ttitlebar"},{"configs":{"instructions":"@Str.enterLogin","itemId":"tfieldset1"},"expanded":true,"children":[{"configs":{"layout":"hbox","itemId":"container1"},"expanded":true,"children":[{"configs":{"itemId":"icon","width":"30","style":"color:#c8c8c8;","html":"<span class='wb_glyph' style='position:relative;top:11px;left:10px;'>&#xf007;<\/span>"},"expanded":false,"children":[],"type":"tcomp"},{"configs":{"itemId":"username","flex":"1","placeHolder":"@Str.username","required":"true"},"expanded":false,"children":[],"type":"ttext"}],"type":"tcontainer"},{"configs":{"layout":"hbox","itemId":"container2","style":"border-bottom:1px solid #c8c8c8;border-top:1px solid #c8c8c8;"},"expanded":true,"children":[{"configs":{"itemId":"icon","width":"30","style":"color:#c8c8c8;","html":"<span class='wb_glyph' style='position:relative;top:13px;left:10px;'>&#xf023;<\/span>"},"expanded":false,"children":[],"type":"tcomp"},{"configs":{"itemId":"password","xtype":"passwordfield","flex":"1","placeHolder":"@Str.password","required":"true"},"expanded":false,"children":[],"type":"ttext"}],"type":"tcontainer"},{"configs":{"layout":"hbox","itemId":"verifyContainer","style":"border-bottom:1px solid #c8c8c8;"},"expanded":true,"children":[{"configs":{"itemId":"icon","width":"30","style":"color:#c8c8c8;","html":"<span class='wb_glyph' style='position:relative;top:13px;left:10px;'>&#xf046;<\/span>"},"expanded":false,"children":[],"type":"tcomp"},{"configs":{"border":"0","itemId":"verifyCode","flex":"1","placeHolder":"@Str.verifyCode","required":"true"},"expanded":false,"children":[],"type":"ttext"},{"configs":{"itemId":"verifyImage","margin":"15 5 0 2","width":"90","height":"20"},"expanded":false,"children":[],"type":"timage","events":{"tap":"app.changeVC();\napp.verifyCode.focus(true, true);"}}],"type":"tcontainer"},{"configs":{"itemId":"saveToggle","labelWidth":"160","label":"@Str.saveUserName"},"expanded":false,"children":[],"type":"ttoggle","events":{"change":"if (!newValue)\n  Ext.util.Cookies.clear('sys.username');"}}],"type":"tfieldset"}],"type":"tcontainer","events":{"painted":"if (!app.notSetData) {\n  var username = Wb.getCookie('sys.username');\n  app.saveToggle.setValue(username ? 1 : 0);\n  if (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  }\n}","destroy":"Wb.loginWinShown = false;","action":"app.login();","initialize":"app.verifyEnabled = '{#Var.sys.session.verifyImage.enabled#}' === 'true';\nif (app.verifyEnabled)\n  app.verifyImage.setSrc('m?xwl=sys/session/get-verify-image');\nelse\n  app.verifyContainer.hide();"}}],"type":"module","events":{"initialize":"Wb.apply(app, {\n  changeVC: function() {\n    app.verifyImage.setSrc('m?xwl=sys/session/get-verify-image&' + Wb.getId());\n  },\n  loginSuccess: function(resp) {\n    if (app.saveToggle.getValue())\n      Wb.setCookie('sys.username', app.username.getValue());\n    window.location = app.referUrl || resp.responseText;\n  },\n  login: function() {\n    if (!Wb.verify(app.win))\n      return;\n    Wb.request({\n      url: 'verify-user',\n      out: app.win,\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});"}}],"roles":{"default":1},"title":"移动登录","iconCls":"","inframe":true,"pageLink":""}