easyink/easyink_Dashboard-master/crm_front/static/js/chunk-46311b47.be9c9bae.js

1 line
16 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-46311b47"],{3722:function(e,t,i){e.exports=i.p+"static/img/login_bg.baa21e8d.svg"},"3a7c":function(e,t,i){e.exports=i.p+"static/img/login-unauth-bg.846a8397.svg"},4917:function(e,t,i){"use strict";i("53c9")},"53c9":function(e,t,i){},"7a3f":function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAARCAYAAADUryzEAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFeSURBVDhP7VO9SgNBEJ5vEAvvwMoHMCGg2NipT2ChCNY2YnEGBPUB7LQKFqbR5KooWguihY+grYWF5ixEbA3kumTHnbuNibkEtfeD22P+v5nZBf0CzXBymYSXIPKIUVyObdRfnYnY/TOIq/lSHOY/nJgCWJYWPTTD3J7TUIZBXCnMCdpHAOZV9oL6Nx9lA+JzITn0g+gAcSW3LcC0GgHx7LlCJG9iqARGTRN0W+CaV3y6+0piZIeJUbYBs/qJUEEze0E04xej06SkQ5Kcza3S94OXa+t/ZVmuwfYp/TQ76Ld1KpPhRaH2lGVYHjrEQdDKYjchMOtONf6nBAPQGNGzWc2fJKIC5ibtMYu0BTtww7vE7S0Sumeyk3T2dFCC4949KzQwDnNnnfUJtyZ0W7adi6H3wDq8A7Tav0YN7r0HmRnonv3NaMFmfrZiI9U6wOz3BieqxPADugyyb+EfRJ/NWK2uMkGa/QAAAABJRU5ErkJggg=="},ce3f:function(e,t,i){e.exports=i.p+"static/img/login-unconfig-bg.c8c34a45.svg"},dd7b:function(e,t,i){"use strict";i.r(t);var s=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticStyle:{width:"100%"}},[s("div",{directives:[{name:"loading",rawName:"v-loading",value:e.webLoginLoading,expression:"webLoginLoading"}],staticClass:"login"},[s("img",{staticClass:"login-logo",style:"top:"+e.logoTop+"px",attrs:{src:i("eea2"),alt:""}}),s("div",{staticClass:"login-wrap"},[s("div",{staticClass:"login-tab-wrap"},[s("div",{directives:[{name:"show",rawName:"v-show",value:!e.isAuth,expression:"!isAuth"}],class:["login-tab",e.activeTab===e.qrCodeLoginType?"active":""],on:{click:function(t){return e.changeActiveTab(e.qrCodeLoginType)}}},[s("div",{staticClass:"login-tab-text",staticStyle:{color:"#6bb4ab"}},[e._v("扫码登录")]),s("div",{staticClass:"login-tab-after"})]),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.isThird,expression:"!isThird"}],class:["login-tab","login-tab2",e.activeTab===e.passwordLoginType?"active":""],on:{click:function(t){return e.changeActiveTab(e.passwordLoginType)}}},[s("div",{staticClass:"login-tab-before"}),s("div",{staticClass:"login-tab-text"},[e._v("账密登录")]),s("div",{staticClass:"login-tab-after"})]),s("div",{directives:[{name:"show",rawName:"v-show",value:e.isAuth,expression:"isAuth"}],class:["login-tab","active"],on:{click:function(t){return e.changeActiveTab(e.qrCodeLoginType)}}},[s("div",{staticClass:"login-tab-text"},[e._v("企业注册")]),s("div",{staticClass:"login-tab-after"})])]),s("div",{staticClass:"login-form-wrap"},[s("div",{directives:[{name:"show",rawName:"v-show",value:e.isThird&&!e.isAuth&&e.isEnterPriseUnAuth,expression:"isThird && !isAuth && isEnterPriseUnAuth"}],staticClass:"login-third-err-wrap"},[s("div",{staticClass:"err-title"},[e._v("登录失败")]),e._m(0),s("el-button",{staticClass:"primary-btn",attrs:{type:"primary"},on:{click:function(t){e.isAuth=!0,e.isEnterPriseUnAuth=!1}}},[e._v("我是企业管理员,去授权")])],1),s("div",{directives:[{name:"show",rawName:"v-show",value:e.isThird&&!e.isAuth&&e.isEnterPriseUnConfig,expression:"isThird && !isAuth && isEnterPriseUnConfig"}],staticClass:"login-third-err-wrap"},[s("div",{staticClass:"err-title"},[e._v("登录失败")]),e._m(1),s("el-button",{attrs:{type:"primary"},on:{click:e.reThirdScan}},[e._v("已配置,重新扫码")])],1),s("div",{directives:[{name:"show",rawName:"v-show",value:e.isThird&&e.isAuth,expression:"isThird && isAuth"}],staticClass:"login-third-auth-wrap"},[e._m(2),s("div",{staticClass:"third-btn-area"},[s("el-button",{directives:[{name:"show",rawName:"v-show",value:!e.isGoneAuth,expression:"!isGoneAuth"}],staticClass:"primary-btn",attrs:{type:"primary"},on:{click:e.gotoAuth}},[e._v("我是企业管理员,去授权")]),s("el-button",{directives:[{name:"show",rawName:"v-show",value:e.isGoneAuth,expression:"isGoneAuth"}],staticClass:"primary-btn",attrs:{type:"primary"},on:{click:function(t){e.isAuth=!1,e.isGoneAuth=!1,e.isEnterPriseUnAuth=!1}}},[e._v("我已授权,去扫码登录")]),s("el-button",{directives:[{name:"show",rawName:"v-show",value:e.isGoneAuth,expression:"isGoneAuth"}],on:{click:e.gotoAuth}},[e._v("重新授权")]),s("el-button",{on:{click:e.gotoRegister}},[e._v("还没有企业微信,去注册")])],1)]),s("div",{directives:[{name:"show",rawName:"v-show",value:e.isThird&&!e.isAuth&&!e.isEnterPriseUnAuth&&!e.isEnterPriseUnConfig,expression:"isThird && !isAuth && !isEnterPriseUnAuth && !isEnterPriseUnConfig"}],staticClass:"login-third-wrap",style:e.authRedict?"justify-content: center;":""},[e.authRedict?e._e():s("div",{staticClass:"step"},[s("p",[e._v("① 企业已注册EasyInk员工可直接扫码登录")]),s("p",[e._v("② 企业未注册EasyInk需要企业管理员前往授权")])]),s("div",{directives:[{name:"show",rawName:"v-show",value:e.isThird&&!e.isAuth&&!e.isEnterPriseUnAuth&&!e.isEnterPriseUnConfig,expression:"isThird && !isAuth && !isEnterPriseUnAuth && !isEnterPriseUnConfig"}],staticClass:"third-btn-area"},[s("el-button",{staticClass:"primary-btn",attrs:{loading:e.loginLoading,type:"primary"},on:{click:e.gotoLogin}},[s("svg",{staticClass:"icon",attrs:{"aria-hidden":"true"}},[s("use",{attrs:{"xlink:href":"#icon-work-logo"}})]),e._v("企业微信扫码登录 ")]),e.authRedict?e._e():s("el-button",{staticStyle:{color:"#6bb4ab"},on:{click:function(t){e.isAuth=!0}}},[s("svg",{staticClass:"icon",attrs:{"aria-hidden":"true"}},[s("use",{attrs:{"xlink:href":"#icon-easyWeCom-logo"}})]),e._v("授权EasyInk ")])],1)]),s("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab===e.qrCodeLoginType&&!e.isThird,expression:"activeTab === qrCodeLoginType && !isThird"}],staticClass:"login-qrcode-wrap"},[s("div",{directives:[{name:"show",rawName:"v-show",value:e.hasEnterprise,expression:"hasEnterprise"}],staticClass:"login-info"},[s("img",{attrs:{src:i("7a3f")}}),s("span",[e._v("员工请在此使用企业微信扫码登录")])]),s("div",{directives:[{name:"show",rawName:"v-show",value:e.hasEnterprise,expression:"hasEnterprise"}],staticClass:"qrcode-area"},[s("div",{staticClass:"qrcode",attrs:{id:"qrcode"}})]),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.hasEnterprise,expression:"!hasEnterprise"}],staticClass:"no-enterprise-info"},[s("el-alert",{attrs:{title:"系统未配置有效企业,请联系系统管理员",type:"warning",closable:!1,"show-icon":""}})],1)]),s("el-form",{directives:[{name:"show",rawName:"v-show",value:e.activeTab===e.passwordLoginType,expression:"activeTab === passwordLoginType"}],ref:"loginForm",staticClass:"login-form",attrs:{model:e.loginForm,rules:e.loginRules}},[s("el-alert",{attrs:{title:"系统超级管理员请在此登录",type:"warning",closable:!1,"show-icon":""}}),s("el-form-item",{attrs:{prop:"username"}},[s("el-input",{attrs:{type:"text","auto-complete":"off",placeholder:"请输入账号"},on:{change:e.autoSetPwd},model:{value:e.loginForm.username,callback:function(t){e.$set(e.loginForm,"username",t)},expression:"loginForm.username"}}),s("i",{staticClass:"iconfont icon-account"})],1),s("el-form-item",{attrs:{prop:"password"}},[s("el-input",{attrs:{type:e.pwdVisible?"text":"password","auto-complete":"off",placeholder:"请输入密码"},model:{value:e.loginForm.password,callback:function(t){e.$set(e.loginForm,"password",t)},expression:"loginForm.password"}}),s("i",{staticClass:"iconfont icon-password"}),s("i",{class:[e.pwdVisible?"icon-plaintext":"icon-ciphertext","iconfont"],on:{click:e.changePwdVisible}})],1),s("el-form-item",{attrs:{prop:"code"}},[s("el-input",{staticStyle:{width:"63%"},attrs:{"auto-complete":"off",placeholder:"请输入验证码"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleLogin(t)}},model:{value:e.loginForm.code,callback:function(t){e.$set(e.loginForm,"code",t)},expression:"loginForm.code"}}),s("i",{staticClass:"iconfont icon-verification"}),s("div",{staticClass:"login-code"},[s("img",{staticClass:"login-code-img",attrs:{src:e.codeUrl},on:{click:e.getCode}})])],1),s("el-checkbox",{staticClass:"fl",staticStyle:{margin:"0px 0px 25px 0px",padding:"10px 0 0 5px"},model:{value:e.loginForm.rememberMe,callback:function(t){e.$set(e.loginForm,"rememberMe",t)},expression:"loginForm.rememberMe"}},[e._v("记住密码")]),s("el-form-item",{staticStyle:{width:"100%"}},[s("el-button",{staticClass:"primary-btn",staticStyle:{width:"100%"},attrs:{loading:e.loading,size:"medium",type:"primary"},nativeOn:{click:function(t){return t.preventDefault(),e.handleLogin(t)}}},[e.loading?s("span",[e._v("登 录 中...")]):s("span",[e._v("登 录")])])],1)],1),e.isEnterPriseUnAuth?s("img",{staticClass:"login-bg-error",attrs:{src:i("3a7c"),alt:""}}):e.isEnterPriseUnConfig?s("img",{staticClass:"login-bg-error",attrs:{src:i("ce3f"),alt:""}}):s("img",{staticClass:"login-bg-default",attrs:{src:i("3722"),alt:""}})],1)])]),s("div",{staticClass:"cp",staticStyle:{position:"absolute",bottom:"20px",width:"100%","text-align":"center",color:"#999"},on:{click:e.openLink}},[e._v(e._s(e.icp))])])},o=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"err-info"},[i("p",[e._v("所在企业未授权EasyInk应用")]),i("p",[e._v("请联系企业管理员前往授权")])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"err-info"},[i("p",[e._v("所在企业未配置通讯录")]),i("p",[e._v("请联系企业管理员登录系统并完善配置")])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"step"},[i("p",[e._v("① 使用EasyInk需通过企业微信授权进行企业验证")]),i("p",[e._v("② 未注册企业微信的用户请先注册")]),i("p",[e._v("③ 完成授权后,需扫码登录系统完成初始化配置")])])}],n=i("5530"),a=i("c7eb"),r=i("1da1"),c=(i("99af"),i("caad"),i("a9e3"),i("ac1f"),i("2532"),i("466d"),i("7ded")),l=i("a78e"),d=i.n(l),u=i("cf45"),g=i("5c96"),h=i("dd70"),p=i("5f87"),v="CODE",m="STATE",w=1,f=2,b=30,C="AUTH_STATE",A="THIRD_LOGIN_STATE",y="SERVER_TYPE",T="WEB_LOGIN",k=1001,E=1e3,x={name:"Login",data:function(){return{activeTab:w,hasEnterprise:!0,codeUrl:"",cookiePassword:"",loginForm:{username:"",password:"",rememberMe:!1,code:""},loginRules:{username:[{required:!0,trigger:"submit",message:"用户名不能为空"}],password:[{required:!0,trigger:"submit",message:"密码不能为空"}],code:[{required:!0,trigger:"submit",message:"验证码不能为空"}]},loading:!1,redirect:void 0,dialogVisible:!0,isDemonstrationLogin:!1,pwdVisible:!1,logoTop:0,isThird:d.a.get(y)===h["bd"]||!1,isAuth:!1,isGoneAuth:!1,authRedict:!1,thirdLoginUrl:"",isEnterPriseUnAuth:!1,isEnterPriseUnConfig:!1,qrCodeLoginType:w,passwordLoginType:f,loginLoading:!1,webLoginLoading:!1,icp:""}},watch:{$route:{handler:function(e){this.redirect=e.query&&e.query.redirect},immediate:!0}},mounted:function(){this.setLogoTop(),window.addEventListener("resize",this.setLogoTop),this.getServerType(),this.checkCode(),this.checkAuthCode()},created:function(){Object(u["C"])()},methods:{checkCode:function(){var e=this,t=window.location.href,i=d.a.get(v),s=d.a.get(m);if(i)if(s===T){var o=t.match(/code=(.*)&state/)[1],n=t.match(/state=(.*)#/)[1],a={code:o,state:n};Object(c["l"])(a).then((function(e){d.a.remove(v),d.a.remove(m)})).catch((function(){d.a.remove(v),d.a.remove(m)}))}else this.wecomLogin(i,s);else if(t.includes("code=")&&!t.includes("auth_code=")&&t.includes("&state=")){var r=t.match(/code=(.*)&state/)[1];if(t.match(/state=(.*)#/)[1]===T){var l=t.match(/state=(.*)#/)[1];d.a.set(v,r),d.a.set(m,l);var u={code:r,state:l};this.webLoginLoading=!0,Object(c["l"])(u).then((function(t){Object(p["c"])(t.data.token),e.$router.push({path:e.redirect||"/"}),d.a.remove(v),d.a.remove(m),e.webLoginLoading=!1})).catch((function(){e.webLoginLoading=!1,d.a.remove(v),d.a.remove(m)}))}else{var g=Number(t.match(/state=(.*)&/)[1]);d.a.set(v,r),d.a.set(m,g),window.location.href="/"}}},checkAuthCode:function(){var e=window.location.href;if(e.includes("auth_code=")){var t=e.match(/auth_code=(.*)&state/)[1];e.includes("state=".concat(C))?(this.authRedict=!0,Object(c["d"])({authCode:t}).then((function(){Object(u["m"])()}))):e.includes("state=".concat(A))&&this.qrcodeLogin3rd(t)}},gotoRegister:function(){window.location.href="https://work.weixin.qq.com/wework_admin/register_wx"},gotoLogin:function(){window.location.href=this.thirdLoginUrl},gotoAuth:function(){var e=this;return Object(r["a"])(Object(a["a"])().mark((function t(){var i;return Object(a["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.isGoneAuth=!0,i=window.open(),Object(c["e"])().then((function(e){var t=e.data,s=t.suiteId,o=t.preAuthCode,n=encodeURIComponent(window.location.origin);i.location.href="https://open.work.weixin.qq.com/3rdapp/install?suite_id=".concat(s,"&pre_auth_code=").concat(o,"&redirect_uri=").concat(n,"&state=").concat(C)})).catch((function(e){i.close()}));case 3:case"end":return t.stop()}}),t)})))()},reThirdScan:function(){this.isEnterPriseUnConfig=!1,this.isEnterPriseUnAuth=!1},getServerType:function(){var e=this;this.$store.dispatch("GetServerType").then((function(t){var i;e.isThird=t.data.serverType===h["bd"],d.a.set(y,t.data.serverType),e.getWxConfig(e.isThird),e.icp=null===t||void 0===t||null===(i=t.data)||void 0===i?void 0:i.icp}))},getWxConfig:function(e){var t=this;e?Object(c["f"])().then((function(e){var i=e.data.appid,s="member",o=encodeURIComponent(window.location.origin);t.thirdLoginUrl="https://open.work.weixin.qq.com/wwopen/sso/3rd_qrConnect?appid=".concat(i,"&redirect_uri=").concat(o,"&state=").concat(A,"&usertype=").concat(s)})):Object(c["a"])().then((function(e){if(e.data){var i=e.data,s=i.corpId,o=i.agentId,n=i.status,a=window.WwLogin;new a({id:"qrcode",appid:s,agentid:o,redirect_uri:window.location.origin,state:n,href:"data:text/css;base64,LmltcG93ZXJCb3ggLnFyY29kZSB7d2lkdGg6IDE2NXB4O30KLmltcG93ZXJCb3ggLndycF9jb2RlIHsKICAgIHdpZHRoOiAyMDBweDsKICAgIGhlaWdodDogMjAwcHg7CiAgICBib3JkZXI6IDFweCBzb2xpZCAjZDdkN2Q3OwogICAgcGFkZGluZzogMTdweDsKICAgIGJveC1zaXppbmc6IGJvcmRlci1ib3g7CiAgICBtYXJnaW46IDIwcHggYXV0byAwIWltcG9ydGFudDsKfQouaW1wb3dlckJveCAudGl0bGUge2Rpc3BsYXk6IG5vbmU7fQouc3RhdHVzX2ljb24ge2Rpc3BsYXk6IG5vbmUgICFpbXBvcnRhbnR9Ci5pbXBvd2VyQm94IC5zdGF0dXMge3RleHQtYWxpZ246IGNlbnRlcjt9CiN3eF9kZWZhdWx0X3RpcCBwOm50aC1jaGlsZCgyKSB7CiAgICBkaXNwbGF5OiBub25lOwp9Cgog",lang:"zh"})}else t.hasEnterprise=!1,t.changeActiveTab(f)})).catch((function(){t.hasEnterprise=!1,t.changeActiveTab(f)}))},wecomLogin:function(e,t){var i=this;this.$store.dispatch("Login",{code:e,state:t,type:"qrcode"}).then((function(){i.$router.push({path:i.redirect||"/"}),d.a.remove(v),d.a.remove(m)})).catch((function(){d.a.remove(v),d.a.remove(m)}))},qrcodeLogin3rd:function(e){var t=this;this.loginLoading=!0,Object(u["m"])(),this.$store.dispatch("Login",{authCode:e,type:"third"}).then((function(){t.$router.push({path:t.redirect||"/"})})).catch((function(e){t.loginLoading=!1,e.code===k?t.isEnterPriseUnAuth=!0:e.code===E?t.isEnterPriseUnConfig=!0:g["Notification"].error({title:e.msg})}))},changeActiveTab:function(e){this.activeTab=e,e===f&&this.getCode()},setLogoTop:function(){var e;this.logoTop=((null===(e=document.getElementsByClassName("login")[0])||void 0===e?void 0:e.offsetTop)-52)/2},getCode:function(){var e=this;Object(c["b"])().then((function(t){e.codeUrl="data:image/gif;base64,"+t.img,e.uuid=t.uuid}))},getCookie:function(e){var t=d.a.get(e),i=d.a.get("rememberMe");this.loginForm={username:void 0===e?this.loginForm.username:e,password:void 0===t?this.loginForm.password:t,rememberMe:void 0!==i&&Boolean(i)}},autoSetPwd:function(){this.getCookie(this.loginForm.username)},handleLogin:function(){var e=this;this.$refs.loginForm.validate((function(t){var i;t&&(e.loading=!0,e.loginForm.rememberMe?(d.a.set(e.loginForm.username,e.loginForm.password,{expires:b}),d.a.set("rememberMe",e.loginForm.rememberMe,{expires:b})):(d.a.remove(e.loginForm.username),d.a.remove("rememberMe")),e.loginForm.uuid=e.uuid,e.$store.dispatch("Login",Object(n["a"])(Object(n["a"])({},e.loginForm),{},{publicKey:null===(i=e.$store.state)||void 0===i||null===(i=i.secretKey)||void 0===i?void 0:i.RSAPublicKey})).then((function(){e.hasEnterprise?e.$router.push({path:e.redirect||"/",query:null}):e.$router.push({path:"/system/configCenter/enterpriseWechat",query:null})})).catch((function(){e.loading=!1,e.getCode()})))}))},changePwdVisible:function(){this.pwdVisible=!this.pwdVisible},openLink:function(){var e="https://beian.miit.gov.cn/";window.open(e)}}},L=x,_=(i("4917"),i("2877")),U=Object(_["a"])(L,s,o,!1,null,"3cc74770",null);t["default"]=U.exports},eea2:function(e,t,i){e.exports=i.p+"static/img/login_logo.a189f728.svg"}}]);