(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-229e8b0d"],{"0932":function(e,t,a){"use strict";var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("CFooter",{attrs:{fixed:!1}},[a("div",[a("span",[e._v(e._s(this.$global.tagging))]),a("span",{staticClass:"ml-1"},[e._v("© "+e._s((new Date).getFullYear())+" ")])]),a("div",{staticClass:"mfs-auto"})])},r=[],s={name:"TheFooter"},i=s,o=a("2877"),l=Object(o["a"])(i,n,r,!1,null,null,null);t["a"]=l.exports},"3c80":function(e,t,a){},"8b48":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticStyle:{height:"100%"}},[a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"c-app mainPage"},[e.login?a("div",{staticClass:" loginBox"},[a("div",{staticClass:"inputArea"},[e._m(0),a("el-input",{staticStyle:{"margin-bottom":"43px"},attrs:{placeholder:"用户名",clearable:""},model:{value:e.userName,callback:function(t){e.userName=t},expression:"userName"}}),a("el-input",{attrs:{placeholder:"密码","show-password":""},model:{value:e.password,callback:function(t){e.password=t},expression:"password"}}),a("span",{staticStyle:{float:"right","margin-top":"5px"}},[a("p",{staticStyle:{cursor:"pointer"},on:{click:function(t){return e.goReg()}}},[e._v("去注册")])]),a("CButton",{staticStyle:{"margin-top":"66px",backgroundColor:"#44C9D1",color:"white",height:"46px"},attrs:{block:""},on:{click:e.loginNow}},[e._v("登录")])],1)]):e._e(),e.login?e._e():a("div",{staticClass:"rBox"},[a("div",{staticClass:"inputArea"},[e._m(1),a("el-input",{staticStyle:{"margin-bottom":"33px"},attrs:{placeholder:"用户名",label:"",clearable:""},model:{value:e.r_uname,callback:function(t){e.r_uname=t},expression:"r_uname"}}),a("el-input",{staticStyle:{"margin-bottom":"33px"},attrs:{label:"",placeholder:"手机号"},model:{value:e.r_tel,callback:function(t){e.r_tel=t},expression:"r_tel"}}),a("el-input",{staticStyle:{"margin-bottom":"30px"},attrs:{label:"",placeholder:"密码","show-password":""},model:{value:e.r_pwd,callback:function(t){e.r_pwd=t},expression:"r_pwd"}}),a("el-input",{staticStyle:{"margin-bottom":"30px"},attrs:{label:"",placeholder:"学校"},model:{value:e.r_group,callback:function(t){e.r_group=t},expression:"r_group"}}),a("span",{staticStyle:{"margin-right":"10px"}},[e._v("请选择身份")]),a("el-select",{attrs:{placeholder:"请选择身份"},on:{change:e.changeIdentity},model:{value:e.r_identity,callback:function(t){e.r_identity=t},expression:"r_identity"}},e._l(e.idList,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1),a("br"),a("br"),a("CButton",{staticStyle:{backgroundColor:"#44C9D1",color:"white",height:"36px",float:"right"},on:{click:function(t){return e.registeNow()}}},[e._v("注册")]),a("p",{staticStyle:{float:"right",height:"36px","line-height":"36px",cursor:"pointer","margin-right":"10px"},on:{click:function(t){return e.goReg()}}},[e._v("已有账号?去登录")])],1)]),a("span",{staticStyle:{color:"white"}},[e._v(e._s(this.$global.tagging)),a("span",{staticClass:"ml-1"},[e._v("© "+e._s((new Date).getFullYear())+" ")])])])])},r=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("h3",{staticClass:"inputHeader"},[e._v("用户登录 "),a("span",{staticClass:"logtext"},[e._v("LOGIN")])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("h3",{staticClass:"inputHeader"},[e._v("用户注册 "),a("span",{staticClass:"logtext"},[e._v("REGISTER")])])}],s=a("c24f"),i=a("5c96"),o=a("0932"),l={name:"Login",components:{TheFooter:o["a"]},data:function(){return{userName:"",password:"",loading:!1,login:!0,r_uname:"",r_tel:"",r_pwd:"",r_group:"",r_identity:2,idList:[{value:1,label:"测试管理员"},{value:2,label:"测试工程师"}]}},methods:{changeSideBar:function(){this.$router.push("/")},loginNow:function(){var e=this;this.loading=!0;var t=new FormData;t.append("username",this.userName),t.append("password",this.password),Object(s["c"])(t).then((function(t){if(40001==t.status)return e.$message.danger("请勿重复登录!"),void(e.loading=!1);localStorage.setItem("identity",t.identify),localStorage.setItem("accessToken",t.token),localStorage.setItem("userName",t.username),localStorage.setItem("userId",t.userid),e.loading=!1,e.$router.push("/dashboard")})),this.loading=!1},registeNow:function(){var e=this,t=new FormData;t.append("username",this.r_uname),t.append("tel",this.r_tel),t.append("password",this.r_pwd),t.append("name",""),t.append("identify",this.r_identity),t.append("group",this.r_group),Object(s["d"])(t).then((function(t){"创建成功"==t&&(Object(i["Message"])({message:"创建成功,请登录",type:"success",duration:3e3}),setTimeout((function(){e.login=!0}),1500))}))},goReg:function(){this.r_uname="",this.r_tel="",this.r_pwd="",this.login=!this.login},registeUser:function(){},changeIdentity:function(){console.log(this.r_identity)}}},c=l,u=(a("ccc6"),a("2877")),d=Object(u["a"])(c,n,r,!1,null,"9be1e39e",null);t["default"]=d.exports},b775:function(e,t,a){"use strict";var n=a("bc3a"),r=a.n(n),s=a("5c96");a("c0d6");r.a.defaults.withCredentials=!0;var i=r.a.create({baseURL:"/api",withCredentials:!0,timeout:1e5});i.interceptors.response.use((function(e){var t=e.data;return t}),(function(e){return console.log("err"+e),e.response.data.length>1e3?Object(s["Message"])({message:"服务器出错",type:"error",duration:3e3}):Object(s["Message"])({message:e.response.data,type:"error",duration:2e4}),Promise.reject(e)})),i.interceptors.request.use((function(e){var t=window.localStorage.getItem("accessToken");return t?(e.headers.accessToken=t,e):e})),t["a"]=i},c24f:function(e,t,a){"use strict";a.d(t,"c",(function(){return r})),a.d(t,"b",(function(){return s})),a.d(t,"a",(function(){return i})),a.d(t,"e",(function(){return o})),a.d(t,"d",(function(){return l}));var n=a("b775");function r(e){return Object(n["a"])({url:"/v1/users/login",method:"POST",data:e})}function s(e){return Object(n["a"])({url:"/v1/users/",method:"GET",params:{user_id:e}})}function i(e){return Object(n["a"])({url:"/v1/users/".concat(e),method:"GET"})}function o(e,t){return Object(n["a"])({url:"/v1/users/".concat(e,"/edit"),method:"POST",data:t})}function l(e){return Object(n["a"])({url:"/v1/users/",method:"POST",data:e})}},ccc6:function(e,t,a){"use strict";a("3c80")}}]);