chunk-26c6a56e.5eb48489.js 9.0 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-26c6a56e"],{2100:function(e,t,i){"use strict";var n=i("f998");i.n(n).a},"3dda":function(e,t){},"433f":function(e,t,i){e.exports=i.p+"view_admin/img/sw.02695d13.jpg"},"59da":function(e,t,i){e.exports=i.p+"view_admin/img/logo-dark.d9a9024c.png"},"975f":function(e,t,i){},a979:function(e,t,i){"use strict";var n=i("975f");i.n(n).a},d666:function(e,t,i){"use strict";i.r(t);var n=i("a34a"),a=i.n(n),r=i("42e3"),s=i("3dda"),o=i.n(s),c=i("d708"),u=i("c276"),l=i("d044"),d=i.n(l);function p(e,t,i,n,a,r,s){try{var o=e[r](s),c=o.value}catch(e){return void i(e)}o.done?t(c):Promise.resolve(c).then(n,a)}function f(e){return function(){var t=this,i=arguments;return new Promise((function(n,a){var r=e.apply(t,i);function s(e){p(r,n,a,s,o,"next",e)}function o(e){p(r,n,a,s,o,"throw",e)}s(void 0)}))}}var m={mixins:[o.a],data:function(){return{roterPre:c.a.roterPre,fullWidth:document.documentElement.clientWidth,swiperOption:{pagination:".swiper-pagination",autoplay:!0},modals:!1,autoLogin:!0,copyrightContext:"",copyrightImage:"",imgcode:"",formInline:{username:"",password:"",code:""},ruleInline:{username:[{required:!0,message:"请输入客服账号",trigger:"blur"}],password:[{required:!0,message:"请输入客服密码",trigger:"blur"}],code:[{required:!0,message:"请输入验证码",trigger:"blur"}]},errorNum:0,jigsaw:null,login_logo:"",swiperList:[],defaultSwiperList:i("433f"),loginType:0,codeKey:"",scanTime:"",rxpired:!1,isMobile:!1,version:"",isScan:!1,timeNum:0}},created:function(){var e=this;Object(r.p)().then((function(t){e.version=t.data.version,t.data.site_name&&(document.title=t.data.site_name)})),this.isMobile=this.$store.state.admin.layout.isMobile;var t=this;top!=window&&(top.location.href=location.href),document.onkeydown=function(e){"login"===t.$route.name&&13===window.event.keyCode&&t.handleSubmit("formInline")},window.addEventListener("resize",this.handleResize),this.getKefuCopy()},watch:{fullWidth:function(e){if(!this.timer){this.screenWidth=e,this.timer=!0;var t=this;setTimeout((function(){t.timer=!1}),400)}},$route:function(e){this.captchas()}},mounted:function(){this.captchas()},methods:{getKefuCopy:function(){var e=this;Object(r.q)().then((function(t){e.copyrightContext=t.data.copyrightContext,e.copyrightImage=t.data.copyrightImage||i("59da")}))},bindScan:function(){this.isScan||(this.isScan=!0,this.getSanCodeKey()),this.loginType=1},creatQrCode:function(){var e="".concat(window.location.protocol,"//").concat(window.location.host,"/pages/users/scan_login/index?key=").concat(this.codeKey);new d.a(this.$refs.qrCodeUrl,{text:e,width:160,height:160,colorDark:"#000000",colorLight:"#ffffff",correctLevel:d.a.CorrectLevel.H})},closeModel:function(){var e=this,t=this.$Message.loading({content:"登录中...",duration:0});Object(r.a)({account:this.formInline.username,password:this.formInline.password,imgcode:this.formInline.code}).then(function(){var i=f(a.a.mark((function i(n){var r;return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return t(),r=e.getExpiresTime(n.data.exp_time),u.a.cookies.setKefu("uuid",n.data.kefuInfo.uid,{expires:r}),u.a.cookies.setKefu("token",n.data.token,{expires:r}),u.a.cookies.setKefu("expires_time",n.data.exp_time,{expires:r}),u.a.cookies.setKefu("kefuInfo",n.data.kefuInfo,{expires:r}),i.next=8,e.$store.dispatch("admin/db/database",{user:!0});case 8:if(i.sent,!e.$store.state.admin.layout.isMobile){i.next=13;break}return i.abrupt("return",e.$router.replace({path:e.$route.query.redirect||"".concat(c.a.routePreKF,"/mobile_list")}));case 13:return i.abrupt("return",e.$router.replace({path:e.$route.query.redirect||"".concat(c.a.routePreKF,"/pc_list")}));case 14:case"end":return i.stop()}}),i)})));return function(e){return i.apply(this,arguments)}}()).catch((function(i){t();var n=void 0===i?{}:i;e.errorNum++,e.captchas(),e.$Message.error(n.msg||"登录失败"),e.jigsaw&&e.jigsaw.reset()}))},getExpiresTime:function(e){var t=Math.round(new Date/1e3);return parseFloat(parseFloat(parseFloat((e-t)/60)/60)/24)},closefail:function(){this.jigsaw&&this.jigsaw.reset(),this.$Message.error("校验错误")},handleResize:function(e){this.fullWidth=document.documentElement.clientWidth},captchas:function(){this.imgcode=c.a.apiBaseURL+"/captcha_pro?"+Date.parse(new Date)},handleSubmit:function(e){var t=this;this.$refs[e].validate((function(e){e&&t.closeModel()}))},getSanCodeKey:function(){var e=this;Object(r.m)().then((function(t){e.codeKey=t.data.key,e.creatQrCode(),e.scanTime=setInterval((function(){e.timeNum++,e.timeNum>=60?(e.timeNum=0,window.clearInterval(e.scanTime),e.rxpired=!0):e.getScanStatus()}),1e3)})).catch((function(t){e.timeNum=0,window.clearInterval(e.scanTime),e.rxpired=!0,e.$Message.error(t.msg)}))},getScanStatus:function(){var e=this;Object(r.K)(this.codeKey).then(function(){var t=f(a.a.mark((function t(i){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0==i.data.status&&(e.timeNum=0,window.clearInterval(e.scanTime),e.rxpired=!0),i.data.status,3!=i.data.status){t.next=17;break}return window.clearInterval(e.scanTime),n=e.getExpiresTime(i.data.exp_time),u.a.cookies.setKefu("uid",i.data.kefuInfo.uid,{expires:n}),u.a.cookies.setKefu("token",i.data.token,{expires:n}),u.a.cookies.setKefu("expires_time",i.data.exp_time,{expires:n}),u.a.cookies.setKefu("kefuInfo",JSON.stringify(i.data.kefuInfo),{expires:n}),t.next=11,e.$store.dispatch("admin/db/database",{user:!0});case 11:if(t.sent,!e.$store.state.admin.layout.isMobile){t.next=16;break}return t.abrupt("return",e.$router.replace({path:e.$route.query.redirect||"".concat(c.a.routePreKF,"/mobile_list")}));case 16:return t.abrupt("return",e.$router.replace({path:e.$route.query.redirect||"".concat(c.a.routePreKF,"/pc_list")}));case 17:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$Modal.error({title:"提示",content:t.msg}),e.timeNum=0,window.clearInterval(e.scanTime),e.rxpired=!0}))},bindRefresh:function(){this.$refs.qrCodeUrl.innerHTML="",this.rxpired=!1,this.getSanCodeKey()}},beforeCreate:function(){},beforeDestroy:function(){this.timeNum=0,this.$refs.qrCodeUrl.innerHTML="",window.clearInterval(this.scanTime),window.removeEventListener("resize",this.handleResize)}},h=(i("2100"),i("a979"),i("2877")),g=Object(h.a)(m,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"wrapper-box"},[i("div",{staticClass:"page-account kf"},[i("div",{staticClass:"content"},[i("img",{attrs:{src:e.copyrightImage,alt:""}}),e._m(0)]),i("img",{staticClass:"copyImg",attrs:{src:e.copyrightImage,alt:""}}),i("div",{staticClass:"container",class:[e.fullWidth>768?"containerSamll":"containerBig"]},[i("div",{staticClass:"index_from page-account-container"},[i("div",{style:{display:e.loginType?"none":"block"}},[e._m(1),i("Form",{ref:"formInline",attrs:{model:e.formInline,rules:e.ruleInline},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleSubmit("formInline")}}},[i("FormItem",{attrs:{prop:"username"}},[i("Input",{attrs:{type:"text",placeholder:"请输入客服账号",size:"large"},model:{value:e.formInline.username,callback:function(t){e.$set(e.formInline,"username",t)},expression:"formInline.username"}})],1),i("FormItem",{attrs:{prop:"password"}},[i("Input",{attrs:{type:"password",placeholder:"请输入客服密码",size:"large"},model:{value:e.formInline.password,callback:function(t){e.$set(e.formInline,"password",t)},expression:"formInline.password"}})],1),i("FormItem",[i("Button",{staticClass:"btn",attrs:{type:"primary",long:"",size:"large"},on:{click:function(t){return e.handleSubmit("formInline")}}},[e._v(e._s(e.$t("page.login.submit"))+"\n ")])],1)],1),e.isMobile?e._e():i("div",{staticClass:"qh_box",on:{click:e.bindScan}},[i("span",{staticClass:"iconfont iconerweima2"})])],1),i("div",{style:{display:e.loginType?"block":"none"}},[e._m(2),i("div",{staticClass:"code-box"},[i("div",{ref:"qrCodeUrl",staticClass:"qrcode"}),i("div",{directives:[{name:"show",rawName:"v-show",value:e.rxpired,expression:"rxpired"}],staticClass:"rxpired-box"},[i("p",[e._v("已过期")]),i("Button",{attrs:{type:"primary"},on:{click:e.bindRefresh}},[e._v("点击刷新")])],1)]),i("div",{staticClass:"qh_box",on:{click:function(t){e.loginType=0}}},[i("span",{staticClass:"iconfont iconzhanghaomima"})])])])])])])}),[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"desc"},[t("p",{staticClass:"tit"},[this._v("让客户服务如此简单")]),t("p",{staticClass:"kefu"},[this._v("专业客服系统"),t("br"),this._v("助力企业打造一流的服务体验")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"page-account-top"},[t("div",{staticClass:"page-account-top-logo"},[this._v("客服登录")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"page-account-top"},[t("div",{staticClass:"page-account-top-logo"},[this._v("微信扫码登录")])])}],!1,null,"7d42e56a",null);t.default=g.exports},f998:function(e,t,i){}}]);