webpackJsonp([2],{"/+5v":function(e,t,s){e.exports=s.p+"static/img/LOGO.70fad89.png"},N2VV:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={data:function(){return{reg:{companyName:"",username:"",password:"",confirmPassword:""},interdiction:!1}},methods:{regFn:function(){var e=this,t=this;/^[a-zA-Z0-9_]{4,16}$/.test(t.reg.username)?t.reg.companyName.length<4||t.reg.companyName.length>200?t.$message({type:"error",message:"公司名称的长度必须在4-250个字符内!"}):/(^(?=.*[a-zA-Z])|(?=.*\d)|(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/])).{4,16}$/.test(t.reg.password)?t.reg.password!==t.reg.confirmPassword?t.$message({type:"error",message:"两次密码不一致！"}):(t.interdiction=!0,t.$http.post(t.$store.state.api+"User",t.reg).then(function(s){t.$message({type:"success",message:"注册成功！"}),t.$http.post(t.$store.state.api+"login",t.reg,{headers:{Authorization:"Bearer "+localStorage.getItem("token")}}).then(function(e){localStorage.setItem("token",e.data.token),localStorage.setItem("role",e.data.role),localStorage.setItem("expires",e.data.expires),t.$message({type:"success",message:"登陆成功！"}),"Admin"==e.data.role?t.$router.push({path:"/admin/config"}):t.$router.push({path:"/"}),t.interdiction=!1},function(s){e.ajax_error(s.status),t.interdiction=!1}),t.interdiction=!1},function(s){e.ajax_error(s.status),t.interdiction=!1})):(alert(t.reg.password.length),t.$message({type:"error",message:"密码必须在4-16位以！"})):t.$message({type:"error",message:"用户名只能包含数字、字母、_且必须是4-16个字符！"})}},created:function(){},mounted:function(){},destroyed:function(){}},a={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{attrs:{id:"login"}},[s("div",{directives:[{name:"loading",rawName:"v-loading",value:e.interdiction,expression:"interdiction"}],staticClass:"login-box"},[e._m(0),e._v(" "),s("el-input",{staticClass:"login-input",attrs:{placeholder:"用户名"},nativeOn:{keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?e.regFn(t):null}},model:{value:e.reg.username,callback:function(t){e.$set(e.reg,"username",t)},expression:"reg.username"}},[s("i",{staticClass:"el-input__icon el-icon-edit",attrs:{slot:"suffix"},slot:"suffix"})]),e._v(" "),s("div",{staticClass:"em"}),e._v(" "),s("el-input",{staticClass:"login-input",attrs:{placeholder:"公司名称"},nativeOn:{keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?e.regFn(t):null}},model:{value:e.reg.companyName,callback:function(t){e.$set(e.reg,"companyName",t)},expression:"reg.companyName"}},[s("i",{staticClass:"el-input__icon el-icon-edit",attrs:{slot:"suffix"},slot:"suffix"})]),e._v(" "),s("div",{staticClass:"em"}),e._v(" "),s("el-input",{staticClass:"login-input",attrs:{placeholder:"密码",type:"password"},nativeOn:{keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?e.regFn(t):null}},model:{value:e.reg.password,callback:function(t){e.$set(e.reg,"password",t)},expression:"reg.password"}},[s("i",{staticClass:"el-input__icon el-icon-view",attrs:{slot:"suffix"},slot:"suffix"})]),e._v(" "),s("div",{staticClass:"em"}),e._v(" "),s("el-input",{staticClass:"login-input",attrs:{placeholder:"密码",type:"password"},nativeOn:{keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?e.regFn(t):null}},model:{value:e.reg.confirmPassword,callback:function(t){e.$set(e.reg,"confirmPassword",t)},expression:"reg.confirmPassword"}},[s("i",{staticClass:"el-input__icon el-icon-view",attrs:{slot:"suffix"},slot:"suffix"})]),e._v(" "),s("div",{staticClass:"em"}),e._v(" "),s("el-button",{staticClass:"submit",attrs:{type:"primary"},on:{click:e.regFn}},[e._v("注册")]),e._v(" "),s("div",{staticClass:"em"}),e._v(" "),s("p",[e._v("已经有账号了? 去\n\t\t\t"),s("router-link",{attrs:{to:"/login"}},[e._v("登陆")])],1),e._v(" "),e._m(1)],1)])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"logo"},[t("img",{attrs:{src:s("/+5v"),alt:""}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{attrs:{id:"bg"}},[t("canvas"),this._v(" "),t("canvas"),this._v(" "),t("canvas")])}]};var r=s("VU/8")(n,a,!1,function(e){s("tSeu")},"data-v-783ee355",null);t.default=r.exports},tSeu:function(e,t){}});