1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-17ebdd26"],{"4e4e":function(t,e,s){},"9ed6":function(t,e,s){"use strict";s.r(e);var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return t.is_login?s("div",{staticClass:"login-container",style:t.loginstyle},[s("div",{class:t.m},[s("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:t.loginForm,rules:t.loginRules,autocomplete:"on","label-position":"left"}},[s("div",{staticClass:"title-container"},["store"==t.m?s("h3",{staticClass:"title"},[t._v("商家后台登录")]):s("h3",{staticClass:"title"},[t._v(t._s(t.sitesetup.ac.title||"系统管理后台登录"))])]),s("el-form-item",{attrs:{prop:"username"}},[s("span",{staticClass:"svg-container"},[s("svg-icon",{attrs:{"icon-class":"user"}})],1),s("el-input",{ref:"username",attrs:{placeholder:"用户名",name:"username",type:"text",tabindex:"1",autocomplete:"on"},model:{value:t.loginForm.username,callback:function(e){t.$set(t.loginForm,"username",e)},expression:"loginForm.username"}})],1),s("el-tooltip",{attrs:{content:"Caps lock is On",placement:"right",manual:""},model:{value:t.capsTooltip,callback:function(e){t.capsTooltip=e},expression:"capsTooltip"}},[s("el-form-item",{attrs:{prop:"password"}},[s("span",{staticClass:"svg-container"},[s("svg-icon",{attrs:{"icon-class":"password"}})],1),s("el-input",{key:t.passwordType,ref:"password",attrs:{type:t.passwordType,placeholder:"密 码",name:"password",tabindex:"2",autocomplete:"on"},on:{blur:function(e){t.capsTooltip=!1}},nativeOn:{keyup:[function(e){return t.checkCapslock(e)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleLogin(e)}]},model:{value:t.loginForm.password,callback:function(e){t.$set(t.loginForm,"password",e)},expression:"loginForm.password"}}),s("span",{staticClass:"show-pwd",on:{click:t.showPwd}},[s("svg-icon",{attrs:{"icon-class":"password"===t.passwordType?"eye":"eye-open"}})],1)],1)],1),s("el-button",{staticStyle:{width:"100%","margin-bottom":"30px"},attrs:{loading:t.loading,type:"primary"},nativeOn:{click:function(e){return e.preventDefault(),t.handleLogin(e)}}},[t._v("登录")])],1),s("div",{staticClass:"copyright",attrs:{align:"center"}},[t.sitesetup.copyright?s("span",[t._v(t._s(t.sitesetup.copyright))]):t._e(),t.sitesetup.icp?s("a",{attrs:{href:"https://beian.miit.gov.cn/",target:"_blank"}},[t._v(t._s(t.sitesetup.icp))]):t._e()])],1)]):t._e()},o=[],r=(s("13d5"),s("5f87")),n={name:"Login",components:{},data(){const t=(t,e,s)=>{e?s():s(new Error("Please enter the correct user name"))},e=(t,e,s)=>{e.length<3?s(new Error("The password can not be less than 3 digits")):s()};return{sitesetup:{ac:[]},loginForm:{},is_login:!0,loginstyle:"",loginRules:{username:[{required:!0,trigger:"blur",validator:t}],password:[{required:!0,trigger:"blur",validator:e}]},passwordType:"password",capsTooltip:!1,loading:!1,showDialog:!1,redirect:void 0,token:void 0,m:"admin",otherQuery:{}}},watch:{$route:{handler:function(t){"3"==this.getQueryString("version")&&(this.is_login=!1),this.getQueryString("m")&&(this.m=this.getQueryString("m"),"store"==this.m&&(this.loginstyle="background-color: #0077AA;"));const e=t.query;e&&(e.token&&(this.is_login=!1,Object(r["e"])(e.token),this.$router.push({path:"/"})),this.redirect=e.redirect,this.otherQuery=this.getOtherQuery(e))},immediate:!0}},created(){},mounted(){""===this.loginForm.username?this.$refs.username.focus():""===this.loginForm.password&&this.$refs.password.focus(),this.$api.post("/login/sitesetup",{i:this.getQueryString("i")}).then(t=>{t.data&&(this.sitesetup="[]"==JSON.stringify(t.data)?{}:t.data,this.sitesetup.ac.title&&(document.title=this.sitesetup.ac.title),this.sitesetup.ac.loginbgimg&&(this.loginstyle={backgroundImage:"url("+this.sitesetup.ac.loginbgimg+")",backgroundRepeat:"no-repeat",backgroundPosition:"center top"}))})},destroyed(){},methods:{getQueryString(t){var e=new RegExp("(^|&)"+t+"=([^&]*)(&|$)","i"),s=window.location.search.substr(1).match(e);return null!=s?unescape(s[2]):null},checkCapslock(t){const{key:e}=t;this.capsTooltip=e&&1===e.length&&e>="A"&&e<="Z"},showPwd(){"password"===this.passwordType?this.passwordType="":this.passwordType="password",this.$nextTick(()=>{this.$refs.password.focus()})},handleLogin(){this.$refs.loginForm.validate(t=>{if(!t)return console.log("error submit!!"),!1;this.loading=!0,this.getQueryString("m")&&(this.loginForm.m=this.getQueryString("m")),this.$store.dispatch("user/login",this.loginForm).then(t=>{1==t.data.is_console?window.open("?console="+t.data.is_console+"#/platform/index","_self"):this.$router.push({path:this.redirect||"/",query:this.otherQuery}),this.loading=!1}).catch(()=>{this.loading=!1})})},getOtherQuery(t){return Object.keys(t).reduce((e,s)=>("redirect"!==s&&(e[s]=t[s]),e),{})}}},a=n,l=(s("fbf21"),s("f1c8"),s("2877")),c=Object(l["a"])(a,i,o,!1,null,"15c4b76e",null);e["default"]=c.exports},f09e:function(t,e,s){},f1c8:function(t,e,s){"use strict";s("f09e")},fbf21:function(t,e,s){"use strict";s("4e4e")}}]);
|