(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-60168737"],{"2da8":function(t,e,n){"use strict";var r=n("68a5"),s=n.n(r);s.a},"68a5":function(t,e,n){},a26d:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("AccountBox",{attrs:{title:"设备管理员登陆"}},[n("Form",{attrs:{model:t.inputUser,"label-position":"top"}},[n("FormItem",{attrs:{label:""}},[n("Input",{attrs:{disabled:!0,placeholder:""},model:{value:t.inputUser.name,callback:function(e){t.$set(t.inputUser,"name",e)},expression:"inputUser.name"}})],1),n("FormItem",{attrs:{label:"密码"}},[n("Input",{attrs:{type:"password",password:""},on:{"on-enter":t.doLogin},model:{value:t.inputUser.password,callback:function(e){t.$set(t.inputUser,"password",e)},expression:"inputUser.password"}})],1),n("FormItem",[n("Button",{staticClass:"login-btn",attrs:{type:"primary"},on:{click:t.doLogin}},[t._v("登录")])],1)],1),n("TipModal",{ref:"tips"}),n("AskRegisterLoginToken",{ref:"askRLT"})],1)},s=[],o=(n("2b45"),n("fc58"),n("cc57"),n("3231")),i=n("064d"),a=n("46d7"),c=n("04e2"),u=n("52ce"),l=n("0372"),f=n("6301"),p=n("fb78"),d=n.n(p),h=n("ab66"),v=n("1a8e"),m=n("aa18"),k=n("b2e6"),b=n("c802"),w=n("6700");function g(t){var e=y();return function(){var n,r=Object(u["a"])(t);if(e){var s=Object(u["a"])(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return Object(c["a"])(this,n)}}function y(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}var L=function(){var t=function(t){Object(a["a"])(n,t);var e=g(n);function n(){var t;return Object(o["a"])(this,n),t=e.apply(this,arguments),t.inputUser={name:"admin",password:""},t}return Object(i["a"])(n,[{key:"mounted",value:function(){}},{key:"doLogin",value:function(){var t=new R(this,this.inputUser,"");t.Go()}}]),n}(k["c"]);return t=Object(l["a"])([Object(k["a"])({directives:{focus:focus},components:{TipModal:v["a"],AskRegisterLoginToken:m["a"],AccountBox:b["a"]}})],t),t}(),T=L,R=function(){function t(e,n,r){Object(o["a"])(this,t),this.vm=e,this.name=n.name,this.password=n.password,this.rlToken=r,this.resp=["",[],""],f["a"].reflect.BindThisMethods(this)}return Object(i["a"])(t,[{key:"Go",value:function(){var t=this;d.a.waterfall([t.trimInput,t.loginByServer,t.askRegisterLoginToken,t.reportError,t.frontendLogin],(function(e,n){t._showFinalError(e,n)}))}},{key:"_showFinalError",value:function(t,e){var n=this;n.vm.$refs.tips.clearAndCloseTips(),t&&"cancel"!==t&&n.vm.$refs.tips.showErrorModal("登录失败",t)}},{key:"trimInput",value:function(t){this.name=this.name.trim(),this.password=this.password.trim(),t(null)}},{key:"loginByServer",value:function(t){var e=this;f["a"].rpc.Client.Login(this.name,this.password,this.rlToken,"",(function(n){console.log("client.Login: ",n),e.resp=n,t(null)}),(function(e){t(e)}))}},{key:"askRegisterLoginToken",value:function(e){var n=this.resp[2];if(""!==n)if(n.indexOf("NeedRegisterLoginToken")<0)e(null);else{var r=this;this.vm.$refs.askRLT.onOK=function(){var n=r.vm.$refs.askRLT.getToken(),s=new t(r.vm,{name:r.name,password:r.password},n);s.Go(),e("cancel")},this.vm.$refs.askRLT.onCancel=function(){e("cancel")},this.vm.$refs.askRLT.showModal()}else e(null)}},{key:"reportError",value:function(t){var e=this.resp[2];t(e)}},{key:"frontendLogin",value:function(t){var e=this.resp[1];if(e&&1===e.length){var n=this.resp[0],r=h["x"].FromSample(e[0]),s=new w["b"](this.vm,n,r,this.name);s.Go()}t(null)}}]),t}(),O=T,j=(n("2da8"),n("4023")),U=Object(j["a"])(O,r,s,!1,null,"2d3f73bb",null);e["default"]=U.exports}}]);