webpackJsonp([3],{"/+5v":function(t,e,n){t.exports=n.p+"static/img/LOGO.70fad89.png"},W2Q3:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={data:function(){return{login:{username:"",password:""},interdiction:!1}},methods:{loginFn:function(){var t=this,e=this;e.interdiction=!0,e.$http.post(e.$store.state.api+"login/cms",e.login,{headers:{Authorization:"Bearer "+localStorage.getItem("token")}}).then(function(t){localStorage.setItem("token",t.data.token),localStorage.setItem("role",t.data.role),localStorage.setItem("expires",t.data.expires),e.$message({type:"success",message:"登陆成功！"}),e.$router.push({path:e.$store.state.callbackUrl}),e.interdiction=!1},function(n){t.ajax_error(n.status),e.interdiction=!1})}},created:function(){var t=this;t.timex()>0?t.$http.get(t.$store.state.api+"token/valid",{headers:{Authorization:"Bearer "+localStorage.getItem("token")}}).then(function(e){t.$router.push({path:t.$store.state.callbackUrl})},function(t){}):t.timex()<=0&&t.refresh_token(function(){t.$http.get(t.$store.state.api+"token/valid",{headers:{Authorization:"Bearer "+localStorage.getItem("token")}}).then(function(e){t.$router.push({path:t.$store.state.callbackUrl})},function(t){})})},mounted:function(){},destroyed:function(){}},a={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"login"}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.interdiction,expression:"interdiction"}],staticClass:"login-box"},[t._m(0),t._v(" "),n("el-input",{staticClass:"login-input",attrs:{placeholder:"用户名"},nativeOn:{keyup:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.loginFn(e):null}},model:{value:t.login.username,callback:function(e){t.$set(t.login,"username",e)},expression:"login.username"}},[n("i",{staticClass:"el-input__icon el-icon-edit",attrs:{slot:"suffix"},slot:"suffix"})]),t._v(" "),n("div",{staticClass:"em"}),t._v(" "),n("el-input",{staticClass:"login-input",attrs:{placeholder:"密码",type:"password"},nativeOn:{keyup:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.loginFn(e):null}},model:{value:t.login.password,callback:function(e){t.$set(t.login,"password",e)},expression:"login.password"}},[n("i",{staticClass:"el-input__icon el-icon-view",attrs:{slot:"suffix"},slot:"suffix"})]),t._v(" "),n("div",{staticClass:"em"}),t._v(" "),n("el-button",{staticClass:"submit",attrs:{type:"primary","native-type":"submit"},on:{click:t.loginFn}},[t._v("登陆")]),t._v(" "),n("div",{staticClass:"em"}),t._v(" "),n("p",[t._v("没有账号? 去\n      "),n("router-link",{attrs:{to:"/register"}},[t._v("注册")])],1)],1)])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"logo"},[e("img",{attrs:{src:n("/+5v")}})])}]};var s=n("VU/8")(i,a,!1,function(t){n("vGga")},"data-v-4f2194d8",null);e.default=s.exports},vGga:function(t,e){}});