webpackJsonp([28],{PhfM:function(t,e){},rqbd:function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=s("FevL"),a=s("P5P/"),n=s("AAHV"),o=s("p1Z8");i.default.component(n.Button.name,n.Button),i.default.component(n.ButtonGroup.name,n.ButtonGroup);var r={data:()=>({title:"登录",user:{name:"",pwd:""}}),created(){var t=Object(a.a)("name");t&&(this.user.name=t),Object(a.b)("token"),localStorage.removeItem("userInfo")},methods:{login(){return""==this.user.name?(Object(o.Toast)({mes:"请输入用户名!",timeout:1e3,icon:"warning"}),!1):""==this.user.pwd?(Object(o.Toast)({mes:"请输入密码!",timeout:1e3,icon:"warning"}),!1):void this.$axios.post(this.api.login,{attr:this.user,type:1}).then(t=>{if(1==t.data.code){var e=t.data.data;Object(a.c)("name",e.name),Object(a.c)("token",e.token),this.$bus.$emit("loginSuccess"),Object(o.Toast)({mes:"登录成功!",timeout:1e3,icon:"success"});var s=this.$route.query.path;s?this.$router.replace(s):this.$router.replace("/")}else Object(o.Toast)({mes:t.data.msg,timeout:1e3,icon:"warning"})},t=>{Object(o.Toast)({mes:"网络请求失败!",timeout:1e3,icon:"error"})})},checkUser(){if(CIM.autologin&&this.api.isWX){let e=encodeURIComponent(window.location.href),s=this.api.wxPayUrl+"?url="+e;if(Object(a.a)("token")&&null!=Object(a.a)("token"))this.$bus.$emit("loginSuccess"),this.$router.replace("/user/index");else if(window.location.href.indexOf("token")>0){const e=this.$route.query.token;if(e&&null!==e){Object(a.c)("token",e);var t=this.$route.query.path;t?this.$router.replace(t):(this.$router.replace("/user/index"),this.$bus.$emit("loginSuccess"))}else this.$dialog.toast({mes:"url格式解析不正确",timeout:1e3})}else window.location=s}}},mounted(){if(window.location.href.indexOf("token")>0){const t=this.$route.query.token;t&&null!==t&&(Object(a.c)("token",t),this.$router.replace("/user/index"),this.$bus.$emit("loginSuccess"))}},computed:{thirdLogin(){if(CIM.autologin&&this.api.isWX)return!0}}},c={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("section",{staticClass:"login"},[s("v-title",{attrs:{title:t.title}}),t._v(" "),s("div",{staticClass:"login-form"},[s("div",{staticClass:"group"},[s("label",{staticClass:"font-two"},[t._v("账号")]),t._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:t.user.name,expression:"user.name"}],staticClass:"form-text",attrs:{type:"text",placeholder:"手机号/用户名/邮箱"},domProps:{value:t.user.name},on:{input:function(e){e.target.composing||t.$set(t.user,"name",e.target.value)}}})]),t._v(" "),s("div",{staticClass:"group"},[s("label",{staticClass:"font-two"},[t._v("密码")]),t._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:t.user.pwd,expression:"user.pwd"}],staticClass:"form-text",attrs:{type:"password",placeholder:"输入密码"},domProps:{value:t.user.pwd},on:{input:function(e){e.target.composing||t.$set(t.user,"pwd",e.target.value)}}})]),t._v(" "),s("div",{staticClass:"btn"},[s("yd-button",{attrs:{type:"danger",size:"large"},nativeOn:{click:function(e){t.login()}}},[t._v("账号登录")])],1),t._v(" "),s("div",{staticClass:"text-right flex"},[s("router-link",{staticClass:"link ",attrs:{to:"/user/register"}},[s("span",{staticClass:"btn register"},[t._v("还没有帐号？去注册")])]),t._v(" "),s("router-link",{staticClass:"link ",attrs:{to:"/index/forget"}},[s("span",{staticClass:"btn register"},[t._v("忘记密码？")])])],1)]),t._v(" "),t.thirdLogin?s("div",{staticClass:"third"},[t._m(0),t._v(" "),s("div",{staticClass:"ways"},[s("div",{staticClass:"way-item",on:{click:function(e){t.checkUser()}}},[s("yd-icon",{staticClass:"icon",attrs:{name:"weixin"}}),t._v(" "),s("span",{},[t._v("微信")])],1)])]):t._e()],1)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"line"},[e("span",[this._v("其他账号快捷登录")])])}]};var l=s("D8HT")(r,c,!1,function(t){s("PhfM")},"data-v-20e59acc",null);e.default=l.exports}});