webpackJsonp([17],{"6E4p":function(t,e,i){t.exports=i.p+"img/login_bg.847e24f.jpg"},"6Qob":function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i("5reh"),n=i("8V46"),a=(i("NTL1"),i("AKaA"),i("mw3O")),r={name:"login",data:function(){return{redirect:this.$route.query.redirect,token:"",form:{loginName:"",password:""},loginbg:i("6E4p"),rules:{},options:[],eid:""}},beforeRouteEnter:function(t,e,i){"/"!==window.location.pathname.slice(-1)&&(window.location=window.location.pathname+"#/"),i()},computed:{imgHeight:function(){return document.body.clientHeight||document.documentElement.clientHeight},imgWidth:function(){return document.body.clientWidth||document.documentElement.clientWidth}},methods:{searchOption:function(){var t=this;if(!this.form.loginName)return Object(n.a)("请输入用户名"),!1;this.axios.get("http://gicdev.demogic.com/api-auth/list-login-enterprise",{params:{loginName:this.form.loginName}}).then(function(e){t.options=e.data.result,e.data.result.length>0&&(t.eid=e.data.result[0].enterpriseId)}).catch(function(t){Object(n.b)(t)})},loginAnimate:function(){new LoginAnimate(loginwrap,{length:90,LineWeight:.1,clicked:!0,moveon:!0}).Run()},getLoginEnterprise:function(){var t=this;this.options.length>0?this.eid?this.axios.post("http://gicdev.demogic.com/api-auth/do-login",a.stringify({loginName:this.form.loginName,password:this.form.password,eid:this.eid})).then(function(e){if(0!=e.data.errorCode)return Object(n.a)(e.data.message),!1;t.options.forEach(function(e){e.enterpriseId==t.eid&&window.localStorage.setItem("brandName",e.brandName)}),Object(n.c)(e.data.message);t.$router.push({path:"/wechatmembers"})}).catch(function(t){Object(n.b)(t)}):Object(n.a)("关联集团不能为空"):this.axios.get("http://gicdev.demogic.com/api-auth/list-login-enterprise",{params:{loginName:this.form.loginName}}).then(function(e){0===e.data.errorCode?(t.options=e.data.result,e.data.result.length>0&&(t.eid=e.data.result[0].enterpriseId),t.eid?t.axios.post("/api-auth/do-login",a.stringify({loginName:t.form.loginName,password:t.form.password,eid:t.eid})).then(function(e){if(0!=e.data.errorCode)return Object(n.a)(e.data.message),!1;t.options.forEach(function(e){e.enterpriseId==t.eid&&window.localStorage.setItem("brandName",e.brandName)}),Object(n.c)(e.data.message);t.$router.push({path:"/wechatmembers"})}).catch(function(t){Object(n.b)(t)}):Object(n.a)(e.data.message)):Object(n.a)()}).catch(function(t){Object(n.b)(t)})},submitLogin:function(t){return this.form.loginName?this.form.password?void this.getLoginEnterprise():(Object(n.a)("密码不能为空"),!1):(Object(n.a)("用户名不能为空"),!1)}},mounted:function(){this.$store.commit(o.a,"达摩网络GIC——连锁零售商业互联网+，终极解决方案！"),document.title=this.$store.state.title}},s={render:function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"loginwrap",style:{height:t.imgHeight+"px",background:"url("+i("6E4p")+") no-repeat center center"}},[o("div",{staticStyle:{position:"absolute",left:"0",height:"0",width:"100%"}},[o("canvas",{attrs:{id:"loginwrap",width:t.imgWidth,height:t.imgHeight}})]),t._v(" "),t._m(0),t._v(" "),o("div",{staticClass:"login_contetnt"},[o("h3",{staticClass:"login-top"},[t._v("让信息连接一切")]),t._v(" "),o("h4",{staticClass:"login-bottom"},[t._v("GIC商户后台")]),t._v(" "),o("div",{staticClass:"formlogin"},[o("el-form",{ref:"form",attrs:{rules:t.rules,model:t.form,"label-width":""}},[o("el-form-item",{attrs:{prop:"loginName"}},[o("el-input",{staticClass:"forminput",attrs:{placeholder:"账号"},on:{blur:t.searchOption},model:{value:t.form.loginName,callback:function(e){t.$set(t.form,"loginName","string"==typeof e?e.trim():e)},expression:"form.loginName"}})],1),t._v(" "),o("el-form-item",{attrs:{prop:"password"}},[o("el-input",{attrs:{type:"password",placeholder:"密码"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.submitLogin("form")}},model:{value:t.form.password,callback:function(e){t.$set(t.form,"password",e)},expression:"form.password"}})],1),t._v(" "),t.options.length>1?o("el-form-item",{attrs:{prop:"eid"}},[o("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择"},model:{value:t.eid,callback:function(e){t.eid=e},expression:"eid"}},t._l(t.options,function(t){return o("el-option",{key:t.enterpriseId,attrs:{label:t.brandName,value:t.enterpriseId}})}),1)],1):t._e(),t._v(" "),o("el-form-item",[o("button",{staticClass:"submit",on:{click:function(e){return e.preventDefault(),t.submitLogin("form")}}},[t._v("立即登录")])])],1)],1)])])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"logintop"},[e("div",{staticClass:"fl loginlogo"},[e("a",{staticClass:"fr logo",attrs:{href:"#"}},[this._v("login_logo.png")])]),this._v(" "),e("a",{staticClass:"home-link fr",attrs:{href:"http://www.demogic.com/"}},[this._v("返回首页")])])}]};var l=i("VU/8")(r,s,!1,function(t){i("IlhW")},null,null);e.default=l.exports},IlhW:function(t,e){}});