后端

2.js 5.0KB

    webpackJsonp([2],{"T+/8":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a("gyMJ"),i=a("0xDb"),r={data:function(){return{dataForm:{userName:"",password:"",uuid:"",captcha:""},dataRule:{userName:[{required:!0,message:"帐号不能为空",trigger:"blur"}],password:[{required:!0,message:"密码不能为空",trigger:"blur"}],captcha:[{required:!0,message:"验证码不能为空",trigger:"blur"}]},captchaPath:""}},created:function(){this.getCaptcha()},methods:{dataFormSubmit:function(){var t=this;this.$refs.dataForm.validate(function(e){if(e){var a={username:t.dataForm.userName,password:t.dataForm.password,uuid:t.dataForm.uuid,captcha:t.dataForm.captcha};n.a.common.login(a).then(function(e){var a=e.data;a&&0===a.code?(t.$cookie.set("token",a.token,{expires:(a.expire||0)+"s"}),t.$router.replace({name:"home"})):(t.getCaptcha(),t.$message.error(a.msg))})}})},getCaptcha:function(){this.dataForm.uuid=Object(i.b)(),this.captchaPath=n.a.common.captcha(this.dataForm.uuid)}}},o={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"site-wrapper site-page--login"},[a("div",{staticClass:"site-content__wrapper"},[a("div",{staticClass:"site-content"},[t._m(0),t._v(" "),a("div",{staticClass:"login-main"},[a("h3",{staticClass:"login-title"},[t._v("管理员登录")]),t._v(" "),a("el-form",{ref:"dataForm",attrs:{model:t.dataForm,rules:t.dataRule,"status-icon":""},nativeOn:{keyup:function(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key))return null;t.dataFormSubmit()}}},[a("el-form-item",{attrs:{prop:"userName"}},[a("el-input",{attrs:{placeholder:"帐号"},model:{value:t.dataForm.userName,callback:function(e){t.$set(t.dataForm,"userName",e)},expression:"dataForm.userName"}})],1),t._v(" "),a("el-form-item",{attrs:{prop:"password"}},[a("el-input",{attrs:{type:"password",placeholder:"密码"},model:{value:t.dataForm.password,callback:function(e){t.$set(t.dataForm,"password",e)},expression:"dataForm.password"}})],1),t._v(" "),a("el-form-item",{attrs:{prop:"captcha"}},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:14}},[a("el-input",{attrs:{placeholder:"验证码"},model:{value:t.dataForm.captcha,callback:function(e){t.$set(t.dataForm,"captcha",e)},expression:"dataForm.captcha"}})],1),t._v(" "),a("el-col",{staticClass:"login-captcha",attrs:{span:10}},[a("img",{attrs:{src:t.captchaPath,alt:""},on:{click:function(e){t.getCaptcha()}}})])],1)],1),t._v(" "),a("el-form-item",[a("el-button",{staticClass:"login-btn-submit",attrs:{type:"primary"},on:{click:function(e){t.dataFormSubmit()}}},[t._v("登录")])],1)],1)],1)])])])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"brand-info"},[e("h2",{staticClass:"brand-info__text"},[this._v("renren-fast-vue")]),this._v(" "),e("p",{staticClass:"brand-info__intro"},[this._v("renren-fast-vue基于vue、element-ui构建开发,实现renren-fast后台管理前端功能,提供一套更优的前端解决方案。")])])}]};var s=a("mPyB")(r,o,!1,function(t){a("cI2R")},null,null);e.default=s.exports},cI2R:function(t,e,a){var n=a("oQir");"string"==typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);a("wkH5")("55764046",n,!0)},npKG:function(t,e,a){t.exports=a.p+"static/img/login_bg.144e19d.jpg"},oQir:function(t,e,a){(t.exports=a("WpAN")(!1)).push([t.i,'\n.site-wrapper.site-page--login {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: rgba(38, 50, 56, 0.6);\n overflow: hidden;\n}\n.site-wrapper.site-page--login:before {\n position: fixed;\n top: 0;\n left: 0;\n z-index: -1;\n width: 100%;\n height: 100%;\n content: "";\n background-image: url('+a("npKG")+");\n background-size: cover;\n}\n.site-wrapper.site-page--login .site-content__wrapper {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n padding: 0;\n margin: 0;\n overflow-x: hidden;\n overflow-y: auto;\n}\n.site-wrapper.site-page--login .site-content {\n min-height: 100%;\n padding: 30px 500px 30px 30px;\n}\n.site-wrapper.site-page--login .brand-info {\n margin: 220px 100px 0 90px;\n color: #fff;\n}\n.site-wrapper.site-page--login .brand-info__text {\n margin: 0 0 22px 0;\n font-size: 48px;\n font-weight: 400;\n text-transform: uppercase;\n}\n.site-wrapper.site-page--login .brand-info__intro {\n margin: 10px 0;\n font-size: 16px;\n line-height: 1.58;\n opacity: .6;\n}\n.site-wrapper.site-page--login .login-main {\n position: absolute;\n top: 0;\n right: 0;\n padding: 150px 60px 180px;\n width: 470px;\n min-height: 100%;\n background-color: #fff;\n}\n.site-wrapper.site-page--login .login-title {\n font-size: 16px;\n}\n.site-wrapper.site-page--login .login-captcha {\n overflow: hidden;\n}\n.site-wrapper.site-page--login .login-captcha > img {\n width: 100%;\n cursor: pointer;\n}\n.site-wrapper.site-page--login .login-btn-submit {\n width: 100%;\n margin-top: 38px;\n}\n",""])}});