(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-6cc1"],{"8v0W":function(e,t,o){},FH45:function(e,t,o){"use strict";var n={name:"SocialSignin",methods:{wechatHandleClick:function(e){alert("ok")},tencentHandleClick:function(e){alert("ok")}}},i=(o("ZAw4"),o("KHd+")),s=Object(i.a)(n,function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"social-signup-container"},[o("div",{staticClass:"sign-btn",on:{click:function(t){return e.wechatHandleClick("wechat")}}},[o("span",{staticClass:"wx-svg-container"},[o("svg-icon",{staticClass:"icon",attrs:{"icon-class":"wechat"}})],1),e._v(" 微信\n ")]),e._v(" "),o("div",{staticClass:"sign-btn",on:{click:function(t){return e.tencentHandleClick("tencent")}}},[o("span",{staticClass:"qq-svg-container"},[o("svg-icon",{staticClass:"icon",attrs:{"icon-class":"qq"}})],1),e._v(" QQ\n ")])])},[],!1,null,"55ed450e",null);s.options.__file="socialsignin.vue";t.a=s.exports},"L/zc":function(e,t,o){"use strict";var n=o("Viu8");o.n(n).a},Viu8:function(e,t,o){},Yfch:function(e,t,o){"use strict";function n(e){return["admin","editor"].indexOf(e.trim())>=0}o.d(t,"a",function(){return n})},ZAw4:function(e,t,o){"use strict";var n=o("8v0W");o.n(n).a},mHh0:function(e,t,o){},ntYl:function(e,t,o){"use strict";o.r(t);var n=o("Yfch"),i=o("ETGp"),s=o("FH45"),a=o("p46w"),r=o.n(a),c={name:"Login",components:{LangSelect:i.a,SocialSign:s.a},data:function(){return{loginForm:{userProductCode:"",username:"",password:"",verificationcode:""},loginRules:{username:[{required:!0,trigger:"blur",validator:function(e,t,o){Object(n.a)(t)?o(new Error("Please enter the correct user name")):o()}}],password:[{required:!0,trigger:"blur",validator:function(e,t,o){t.length<3?o(new Error("The password can not be less than 3 digits")):o()}}],verificationcode:[{required:!0,trigger:"blur",message:"验证码必填"},{type:"number",trigger:"blur",message:"验证码不是数字"}]},passwordType:"password",loading:!1,showDialog:!1,redirect:void 0,codeImgData:null,checkcode:!1,userList:[],showUserProduct:!1,basicInfo:{}}},watch:{$route:{handler:function(e){this.redirect=e.query&&e.query.redirect},immediate:!0}},created:function(){this.userList=r.a.getJSON("userList")||[],this.getBasicInfo()},mounted:function(){this.getVerificationCodeImg()},destroyed:function(){},methods:{showPwd:function(){"password"===this.passwordType?this.passwordType="":this.passwordType="password"},handleLogin:function(){var e=this,t=this;this.$refs.loginForm.validate(function(o){if(!o)return e.$notify.error({title:"验证消息",message:"校验信息不正确,请正确填写!"}),!1;e.loading=!0;var n=e.common.getUserGuid(),i=t.loginForm.verificationcode;if(e.checkcode||(i="pass"),e.checkcode&&"pass"===i)return e.$notify.error({title:"验证消息",message:"验证码不正确,请正确填写!"}),!1;var s={openNodeApi:!0,userProductCode:t.loginForm.userProductCode,userName:t.loginForm.username,userPwd:t.loginForm.password,validateCode:i,guid:n};e.autoLogin(s)})},autoLogin:function(e){var t=this;this.common.ajax("/api/auth/login",e,function(o){if(o.result){t.$message.success(o.msg),r.a.remove("needcheckCode"),t.$store.dispatch("LoginByUsername",{userInfo:o.data,menuList:o.dynamic}).then(function(){t.loading=!1,t.$router.push({path:t.redirect||"/"})}).catch(function(){t.loading=!1});var n=o.data.userProductCode;t.userList.find(function(e){return e.userProductCode===n})||(e.userProductCode=n,e.validateCode="pass",t.userList.push(e)),r.a.set("userList",t.userList)}else{t.$message.error(o.msg);var i=r.a.get("needcheckCode");null!==i&&""!==i?(i=parseInt(i)+1,r.a.set("needcheckCode",i),t.checkcode=i>=3):(t.checkcode=!1,r.a.set("needcheckCode",1)),501===o.statusCode&&(t.showUserProduct=!0),t.loading=!1}t.getVerificationCodeImg()},this.$refs.loginForm)},getVerificationCodeImg:function(){if(r.a.get("needcheckCode")>=3){this.checkcode=!0;var e=this,t={openNodeApi:!0,guid:this.common.getUserGuid()};this.common.ajax("/api/Auth/GetValidateCode",t,function(t,o){t.result?e.codeImgData="data:image/png;base64,"+t.data:e.$message.error(t.msg)},!0)}else this.checkcode=!1},goLoginPage:function(){window.location.href="#/login"},goRegPage:function(){window.location.href="http://plat-site-test.iwms.xin/#/reg"},closeUserInfo:function(e){var t=this.userList.findIndex(function(t){return t.userProductCode===e.userProductCode});this.userList.splice(t,1),r.a.set("userList",this.userList)},getBasicInfo:function(){var e=this;this.common.ajax("/api/sys/basicInfo/getSysInfo",{href:location.href},function(t){e.basicInfo=t.data,e.$store.dispatch("setBasicInfo",e.basicInfo),document.title=e.basicInfo.sysName;var o=document.querySelector('link[rel="icon"]'),n=e.basicInfo.icon;null!==o?o.href=n:((o=document.createElement("link")).rel="icon",o.href=n,document.head.appendChild(o))})}}},l=(o("L/zc"),o("rQjR"),o("KHd+")),d=Object(l.a)(c,function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"login-container"},[o("div",{staticClass:"header"},[o("img",{staticClass:"logo",attrs:{src:e.common.showFirstImage(e.basicInfo.logo)}}),e._v(" "),o("div",{staticClass:"tool"})]),e._v(" "),o("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:e.loginForm,rules:e.loginRules,"auto-complete":"on","label-position":"left"}},[o("div",{staticClass:"title-container"},[o("h3",{staticClass:"title"},[e._v("欢迎登录"+e._s(e.basicInfo.sysName))])]),e._v(" "),e.showUserProduct?o("el-form-item",{attrs:{prop:"userProductCode"}},[o("span",{staticClass:"svg-container"},[o("svg-icon",{attrs:{"icon-class":"user"}})],1),e._v(" "),o("el-input",{attrs:{placeholder:e.$t("login.userProductCode"),name:"userProductCode",type:"text","auto-complete":"on"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleLogin(t)}},model:{value:e.loginForm.userProductCode,callback:function(t){e.$set(e.loginForm,"userProductCode",t)},expression:"loginForm.userProductCode"}})],1):e._e(),e._v(" "),o("el-form-item",{attrs:{prop:"username"}},[o("span",{staticClass:"svg-container"},[o("i",{staticClass:"el-icon-yrt-dianhua3"})]),e._v(" "),o("el-input",{attrs:{placeholder:e.$t("login.username"),name:"username",type:"text","auto-complete":"on"},model:{value:e.loginForm.username,callback:function(t){e.$set(e.loginForm,"username",t)},expression:"loginForm.username"}})],1),e._v(" "),o("el-form-item",{attrs:{prop:"password"}},[o("span",{staticClass:"svg-container"},[o("svg-icon",{attrs:{"icon-class":"password"}})],1),e._v(" "),o("el-input",{attrs:{type:e.passwordType,placeholder:e.$t("login.password"),name:"password","auto-complete":"on",autocomplete:"new-password"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleLogin(t)}},model:{value:e.loginForm.password,callback:function(t){e.$set(e.loginForm,"password",t)},expression:"loginForm.password"}}),e._v(" "),o("span",{staticClass:"show-pwd",on:{click:e.showPwd}},[o("svg-icon",{attrs:{"icon-class":"password"==e.passwordType?"eye":"eye-open"}})],1)],1),e._v(" "),e.checkcode?o("el-form-item",{attrs:{prop:"verificationcode"}},[o("span",{staticClass:"svg-container"},[o("svg-icon",{attrs:{"icon-class":"verification-code"}})],1),e._v(" "),o("el-input",{attrs:{placeholder:e.$t("login.verificationcode"),name:"verificationcode","auto-complete":"off"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleLogin(t)}},model:{value:e.loginForm.verificationcode,callback:function(t){e.$set(e.loginForm,"verificationcode",e._n(t))},expression:"loginForm.verificationcode"}}),e._v(" "),o("span",{staticClass:"show-pwd",on:{click:e.getVerificationCodeImg}},[o("img",{ref:"codeimg",staticStyle:{width:"80px",height:"30px","margin-top":"3px"},attrs:{src:e.codeImgData}})])],1):e._e(),e._v(" "),o("el-button",{staticClass:"btn-login",attrs:{loading:e.loading,type:"primary"},nativeOn:{click:function(t){return t.preventDefault(),e.handleLogin(t)}}},[e._v(e._s(e.$t("login.logIn")))])],1),e._v(" "),o("el-dialog",{attrs:{title:e.$t("login.thirdparty"),visible:e.showDialog,"append-to-body":""},on:{"update:visible":function(t){e.showDialog=t}}},[e._v("\n "+e._s(e.$t("login.thirdpartyTips"))+"\n "),o("br"),e._v(" "),o("br"),e._v(" "),o("br"),e._v(" "),o("social-sign")],1)],1)},[],!1,null,"4bb4af7e",null);d.options.__file="index.vue";t.default=d.exports},rQjR:function(e,t,o){"use strict";var n=o("mHh0");o.n(n).a}}]);
|