EMS2.0-Documents/7.部署文档/Window安装/项目前端文件/IEMS/js/chunk-34e4a09c.8ebcc55e.js

2 lines
4.3 KiB
JavaScript
Raw Permalink Normal View History

2024-11-28 09:29:02 +08:00
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-34e4a09c"],{"9ed6":function(e,t,o){"use strict";o.r(t);var r=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"login-container"},[o("div",{staticClass:"name"}),o("div",{staticClass:"login-box"},[o("div",{staticClass:"title"},[e._v(" "+e._s(e.$t("login.title"))+" ")]),o("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:e.loginForm,rules:e.loginRules}},[o("el-form-item",{attrs:{prop:"username"}},[o("el-input",{attrs:{placeholder:e.$t("pEnter")+e.$t("login.username"),name:"username",type:"text",autocomplete:""},model:{value:e.loginForm.username,callback:function(t){e.$set(e.loginForm,"username",t)},expression:"loginForm.username"}})],1),o("el-form-item",{attrs:{prop:"password"}},[o("el-input",{attrs:{placeholder:e.$t("pEnter")+e.$t("login.password"),"show-password":""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleLogin.apply(null,arguments)}},model:{value:e.loginForm.password,callback:function(t){e.$set(e.loginForm,"password",t)},expression:"loginForm.password"}})],1),o("el-form-item",{staticClass:"yanzheng",attrs:{prop:"imageStr"}},[o("el-input",{attrs:{placeholder:e.$t("pEnter")+e.$t("login.imageStr")},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleLogin.apply(null,arguments)}},model:{value:e.loginForm.imageStr,callback:function(t){e.$set(e.loginForm,"imageStr",t)},expression:"loginForm.imageStr"}}),o("img",{staticClass:"imageStr",attrs:{src:e.img},on:{click:e.changeImage}}),o("div",{staticClass:"replace",on:{click:e.changeImage}},[e._v(" "+e._s(e.$t("login.replace"))+" ")])],1),o("div",{staticClass:"flex"},[o("div",{staticClass:"login",on:{click:e.handleLogin}},[e._v(" "+e._s(e.$t("login.login"))+" ")])])],1)],1)])},n=[],i=(o("d9e2"),o("b775")),a=o("3785"),s={name:"Login",data:function(){var e=function(e,t,o){t?o():o("账户不能为空")},t=function(e,t,o){t.length<1?o(new Error("密码不能为空")):o()},o=function(e,t,o){t.length<1?o(new Error("请输入验证码")):o()};return{url:"",img:"",checkStr:"",loginForm:{username:"",password:"",imageStr:""},loginRules:{username:[{required:!0,trigger:"blur",validator:e}],password:[{required:!0,trigger:"blur",validator:t}],imageStr:[{required:!0,trigger:"blur",validator:o}]},loading:!1,showDialog:!1,redirect:void 0,checked:!0,siteName:"",flag:!0,lang:this.$i18n.locale}},computed:{logoForm:{get:function(){return this.$store.state.user.logoForm}}},watch:{$route:{handler:function(e){this.redirect=e.query&&e.query.redirect},immediate:!0}},created:function(){this.url=this.$store.state.user.url,this.img=this.url+"/user-service/user/getVerifyImg",i["a"].defaults.withCredentials=!0,"true"===localStorage.getItem("sitechecked")?this.checked=!0:this.checked=!1,this.getlocalStorage()},mounted:function(){this.changeImage()},destroyed:function(){},methods:{handleLogin:function(){var e=this;this.$refs.loginForm.validate((function(t){if(!t)return console.log("error submit!!"),!1;e.loading=!0,e.$store.dispatch("LoginByUsername",e.loginForm).then((function(){e.loading=!1,e.$store.dispatch("GenerateRoutes"),e.setlocalStorage2(e.loginForm.username),!0===e.checked&&e.setlocalStorage(e.loginForm.username),Object(a["b"])().then((function(t){console.log(t),e.$store.state.user.logoForm=t.data||{},e.$router.push({path:e.redirect||"/map/GIS"})}))})).catch((function(){e.loading=!1}))}))},setlocalStorage:function(e){localStorage.setItem("sitename",e)},setlocalStorage2:function(e){localStorage.setItem("sitename2",e)},getlocalStorage:function(){this.loginForm.username=localStorage.getItem("sitename2"),this.loginForm.username||(this.loginForm.username="")},changes:function(e){localStorage.setItem("sitechecked",e),e||(this.setlocalStorage(""),this.loginForm.username="")},changeImage:function(){var e=this;if(setTimeout((function(){e.flag=!0}),1e3),this.flag){this.flag=!1;var t=Math.ceil(10*Math.random());this.img=this.url+"/user-service/user/getVerifyImg?"+t}}}},l
//# sourceMappingURL=chunk-34e4a09c.8ebcc55e.js.map