WangHan
2025-04-03 a1b85ef72062ca80db35546e4216dd564f3e0f57
1
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7a509419"],{"0048":function(e,t,o){},1328:function(e,t,o){"use strict";o("e526")},7286:function(e,t,o){"use strict";o("0048")},e526:function(e,t,o){},e792:function(e,t,o){e.exports=o.p+"static/img/login-name.7a3f407a.png"},f11b:function(e,t,o){"use strict";o.r(t);var i=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"login-bg"},[i("img",{staticClass:"logo-name",attrs:{src:o("e792"),alt:"一体化运维服务支撑平台"}}),e._v(" "),i("div",{staticClass:"index_from"},[i("div",{staticClass:"page-account-top"},[e._v("\n      欢迎登录\n    ")]),e._v(" "),i("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:e.loginForm,rules:e.loginRules,autocomplete:"on","label-position":"left"},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleLogin(t)}}},[i("el-form-item",{attrs:{prop:"account"}},[i("el-input",{attrs:{"prefix-icon":"el-icon-user",placeholder:"用户名",type:"text",tabindex:"1",autocomplete:"off"},model:{value:e.loginForm.account,callback:function(t){e.$set(e.loginForm,"account","string"===typeof t?t.trim():t)},expression:"loginForm.account"}})],1),e._v(" "),i("el-form-item",{attrs:{prop:"password"}},[i("el-input",{key:e.passwordType,attrs:{"prefix-icon":"el-icon-lock",type:e.passwordType,placeholder:"密码",tabindex:"2","auto-complete":"off"},model:{value:e.loginForm.password,callback:function(t){e.$set(e.loginForm,"password","string"===typeof t?t.trim():t)},expression:"loginForm.password"}}),e._v(" "),i("span",{staticClass:"show-pwd",on:{click:e.showPwd}},[i("svg-icon",{attrs:{"icon-class":"password"===e.passwordType?"eye":"eye-open"}})],1)],1),e._v(" "),"code"===e.loginForm.verifyType&&e.captchaEnabled?i("el-form-item",{staticClass:"captcha",attrs:{prop:"code"}},[i("div",{staticClass:"captcha"},[i("el-input",{staticStyle:{width:"218px"},attrs:{"prefix-icon":"el-icon-message",placeholder:"验证码",type:"text",tabindex:"3",autocomplete:"off"},model:{value:e.loginForm.code,callback:function(t){e.$set(e.loginForm,"code","string"===typeof t?t.trim():t)},expression:"loginForm.code"}}),e._v(" "),i("div",{staticClass:"imgs",on:{click:function(t){return e.getCode()}}},[i("img",{attrs:{src:e.codeUrl}}),e._v(" "),i("span",{directives:[{name:"show",rawName:"v-show",value:e.showCaptchatImg,expression:"showCaptchatImg"}]},[e._v("已失效")])])],1)]):e._e(),e._v(" "),i("div",{staticClass:"acea-row"},[i("el-button",{staticStyle:{width:"100%","margin-bottom":"80px"},attrs:{loading:e.loading,type:"primary",disabled:e.disabled},nativeOn:{click:function(t){return t.preventDefault(),e.handleLogin(t)}}},[e._v("登录\n        ")])],1)],1)],1)])},s=[],n=(o("61f7"),o("c24f")),r={name:"Login",data:function(){return{verify:!1,showCaptchatImg:!1,codeUrl:"",fullWidth:document.body.clientWidth,swiperOption:{pagination:{el:".pagination"},autoplay:{enabled:!1,disableOnInteraction:!1,delay:3e3}},loginForm:{account:"supervisor",password:"123456",uuid:"",code:"",loginType:"user_pass",verifyType:"code"},loginRules:{account:[{required:!0,trigger:"blur",message:"请输入用户名"}],password:[{required:!0,trigger:"blur",message:"请输入密码"}],code:[{required:!0,message:"请输入正确的验证码",trigger:"blur"}]},passwordType:"password",capsTooltip:!1,loading:!1,showDialog:!1,redirect:void 0,otherQuery:{},disabled:!1,isWeixin:this.$wechat.isWeixin(),captchaEnabled:!0}},components:{},watch:{fullWidth:function(e){if(!this.timer){this.screenWidth=e,this.timer=!0;var t=this;setTimeout((function(){t.timer=!1}),400)}},$route:{handler:function(e){var t=e.query;t&&(this.redirect=t.redirect,this.otherQuery=this.getOtherQuery(t))},immediate:!0}},created:function(){var e=this;document.onkeydown=function(t){if(-1!==e.$route.path.indexOf("login")){var o=window.event.keyCode;13===o&&e.handleLogin()}},window.addEventListener("resize",this.handleResize)},mounted:function(){""===this.loginForm.account?this.$refs.account.focus():""===this.loginForm.pwd&&this.$refs.password.focus(),this.getCode()},methods:{verifyTrue:function(){this.verify=!0},verifyFalse:function(){this.verify=!1},checkCapslock:function(e){var t=e.key;this.capsTooltip=t&&1===t.length&&t>="A"&&t<="Z"},showPwd:function(){var e=this;"password"===this.passwordType?this.passwordType="":this.passwordType="password",this.$nextTick((function(){e.$refs.pwd.focus()}))},handleLogin:function(){var e=this;this.$refs.loginForm.validate((function(t){if(!t)return!1;e.success(null)}))},success:function(e){var t=this;this.loginForm.captcha=this.$store.state.user.captcha;var o=this.$loading({lock:!0,text:"正在登录中."});this.$store.dispatch("user/login",this.loginForm).then((function(){t.$store.dispatch("user/getInfo").then((function(e){t.$router.push({path:t.redirect||"/dashboard",query:t.otherQuery}),o.close(),t.disabled=!0})).catch((function(e){o.close(),t.disabled=!1,t.$wechat.isPhone()&&t.$dialog.error(e.message),t.loginForm.code=null,t.getCode()}))})).catch((function(e){o.close(),t.disabled=!1,t.$wechat.isPhone()&&t.$dialog.error(e.message),t.loginForm.code=null,t.getCode()}))},getCode:function(){var e=this;"code"===this.loginForm.verifyType?Object(n["d"])().then((function(t){e.captchaEnabled=void 0===t.captchaEnabled||t.captchaEnabled,e.captchaEnabled&&(e.codeUrl="data:image/jpeg;base64,"+t.img),e.loginForm.uuid=t.uuid,e.showCaptchatImg=!1,setTimeout((function(){e.showCaptchatImg=!0}),27e4)})).catch((function(e){console.log(e)})):"jigsaw"===this.loginForm.verifyType?(this.loginForm.code="jigsaw",this.loginForm.uuid=""):"slide"===this.loginForm.verifyType||"sms"===this.loginForm.verifyType?Object(n["e"])().then((function(t){e.loginForm.uuid=t.uuid})).catch((function(e){console.error(e)})):this.$message.error("不支持的验证码类型:"+this.loginForm.verifyType)},getOtherQuery:function(e){return Object.keys(e).reduce((function(t,o){return"redirect"!==o&&(t[o]=e[o]),t}),{})}}},a=r,c=(o("1328"),o("7286"),o("2877")),l=Object(c["a"])(a,i,s,!1,null,"50724f27",null);t["default"]=l.exports}}]);