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