| 1 |
- import{g as e,s,n as t,a as o,h as a,r as i,u as n,b as l,c as r,l as c,d,e as h,f as m,i as u,j as g,k as f,m as p,w as k,o as C,p as y,q as A,t as b,v as w,x as I,y as U,z as _,A as x,B as L,F,C as P,D,E as T,G as j}from"./index-C9TJPork.js";import{_ as v}from"./u-image.rajv-jH8.js";import{r as V}from"./uni-app.es.CUt9gedF.js";import{_ as E}from"./u-input.cq_N7lcW.js";import{_ as B,a as N}from"./u-form.D7hQ6Wil.js";import{_ as R}from"./u-checkbox.DJ2PERbW.js";import{_ as S}from"./u-button.C_4h_wUh.js";import{_ as q}from"./u-divider.OXt8wuKL.js";import{_ as J}from"./u-popup.7vl_vYde.js";import{m as Y}from"./md5.6s00qotZ.js";import{_ as G}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./u-icon.BNGPST4x.js";import"./emitter.DrjJCwnj.js";const K="/assets/logo-Bqxzj-rq.png";const O=G({data:()=>({remember:!1,logoImg:K,imgUrl:"",loading:!1,formData:{account:"",password:"",code:"",origin:"password"},needCode:!1,codeLength:4,isCode:!1,rules:{account:[{required:!0,message:"请输入账号",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}]},sysConfigInfo:{},appIcon:"",sysName:"",copyright:"",isCopyright:!0,socialsList:[],show:!1,tenantUserInfo:[],ssoLoading:!0,isSso:!1,ssoTicket:"",ssoUrl:"",preUrl:"",ticketParams:"",loginCode:"",isKeyUp:!0}),watch:{remember:{handler(t){let o=e("rememberAccount");o||(o={account:"",password:""}),o.remember=t,s("rememberAccount",o)},deep:!0}},computed:{baseURL(){return this.define.baseURL}},onReady(){this.$refs.dataForm.setRules(this.rules)},onLoad(s){(null==s?void 0:s.JNPF_TICKET)&&(this.ssoTicket=s.JNPF_TICKET,t({url:`/pages/login/otherLogin?ssoTicket=${this.ssoTicket}`})),this.ssoTicket=e("ssoTicket"),this.sysConfigInfo=e("sysConfigInfo"),this.appIcon=this.sysConfigInfo.appIcon?this.baseURL+this.sysConfigInfo.appIcon:K,this.sysName=this.sysConfigInfo.companyName?this.sysConfigInfo.sysName:"USKY快速开发平台",this.copyright=this.sysConfigInfo.copyright?this.sysConfigInfo.copyright:this.define.copyright;let o=e("app_loginNeedCode");this.isCode=o,this.changeCode(),this.getLoginConfig(),this.formData.password="",s.data&&(this.tenantUserInfo=JSON.parse(s.data),this.tenantUserInfo&&(this.show=!0)),this.initAccount()},methods:{initAccount(){let s=e("rememberAccount");s&&s.remember&&(s.account&&(this.formData.account=this.jnpf.aesEncryption.decrypt(s.account)),s.password&&(this.formData.password=this.jnpf.aesEncryption.decrypt(s.password))),this.remember=s.remember},rememberAccount(){if(this.remember){let e={remember:!0};e.account=this.jnpf.aesEncryption.encrypt(this.formData.account),e.password=this.jnpf.aesEncryption.encrypt(this.formData.password),s("rememberAccount",e)}},loginHandel(){o({title:"登录中"}),userStore.getCurrentUser().then((e=>{a(),i({url:"/pages/index/index"})})).catch((()=>{a(),i({url:"/pages/login/index"})}))},loginToken(e){if(n().setToken(e.data.value),2!=e.data.status){if(1==e.data.status)return this.loginHandel();6==e.data.status?(this.tenantUserInfo=JSON.parse(e.data.value),1==this.tenantUserInfo.length?this.loginHandel():this.show=!0):(this.show=!1,this.ssoUrl="",l({title:e.data.value||"操作超时,请重新点击登录",icon:"none"}))}},wechatLogin(){},qqOtherlogin(){r().then((e=>{this.ssoTicket=e.data,c({provider:"qq",success:e=>{uni.getUserInfo({provider:"qq",success:e=>{let s={source:"qq",jnpf_ticket:this.ssoTicket,socialName:e.userInfo.nickName,uuid:e.userInfonickName.unionid};d(s).then((e=>{this.loginToken(e)})).catch((e=>{}))}})}})}))},socailsLogin(e){const s=n();e.tenantLogin=!0,d(e).then((e=>{200==e.code&&(o({title:"登录中"}),s.setToken(e.data.token),s.getCurrentUser().then((e=>{a(),h({url:"/pages/index/index"}),this.show=!1})).catch((()=>{a(),h({url:"/pages/login/index"})})))})).catch((()=>{a(),h({url:"/pages/login/index"})}))},otherslogin(e,o){"wechat_open"===e?this.wechatLogin():r().then((e=>{this.ssoTicket=e.data,o=o.replace("JNPF_TICKET",this.ssoTicket),s("ssoUrl",o),t({url:"/pages/login/otherLogin?ssoTicket="+this.ssoTicket})})).catch((()=>{}))},onFocus(e){this.getCodeConfig(e)},onBlur(e){this.getCodeConfig(e)},getLoginConfig(){m().then((e=>{this.isSso=e.data.redirect,this.preUrl=e.data.url,this.ticketParams=e.data.ticketParams;let s=e.data.socialsList||[];this.socialsList=s.filter((e=>e.latest&&"github"!=e.enname&&"wechat_enterprise"!=e.enname)),this.ssoLoading=!1})).catch((()=>{this.isSso=!1,this.ssoLoading=!1}))},getCodeConfig(e){e&&u(e).then((e=>{this.needCode=!!e.data.enableVerificationCode,this.needCode&&(this.codeLength=e.data.verificationCodeNumber||4,this.changeCode())}))},changeCode(){let e=Math.random();this.timestamp=e,this.imgUrl=`/api/oauth/ImageCode/${this.codeLength||4}/${e}`},login(){const e=n();this.$refs.dataForm.validate((s=>{if(s){this.loading=!0;const s=Y.md5(this.formData.password),t=this.jnpf.aesEncryption.encrypt(s);let o={account:this.formData.account,password:t,timestamp:this.timestamp,code:this.formData.code,origin:this.formData.origin,jnpf_ticket:this.ssoTicket,grant_type:"password"};g(o).then((s=>{let t=s.data.token;e.setToken(t),this.rememberAccount(),e.getCurrentUser().then((e=>{this.loading=!1,h({url:"/pages/index/index"})})).catch((()=>{this.loading=!1}))})).catch((e=>{this.getCodeConfig(this.formData.account),this.formData.code="",this.changeCode(),this.loading=!1}))}}))},ssoLogin(){r().then((e=>{this.ssoTicket=e.data,this.ssoUrl=this.preUrl+"?"+this.ticketParams+"="+this.ssoTicket,s("ssoUrl",this.ssoUrl),t({url:`/pages/login/otherLogin?ssoTicket=${this.ssoTicket}`})}))}}},[["render",function(e,s,t,o,a,i){const n=D,l=V(f("u-image"),v),r=C,c=V(f("u-input"),E),d=V(f("u-form-item"),B),h=V(f("u-form"),N),m=V(f("u-checkbox"),R),u=V(f("u-button"),S),g=V(f("u-divider"),q),Y=j,G=V(f("u-popup"),J);return y(),p(r,{class:"logo-v"},{default:k((()=>[A(r,{class:"login-bg"},{default:k((()=>[A(n,{src:"/assets/login-bg-DxH86LPG.jpg",mode:"widthFix"}),A(r,{class:"logoImg"},{default:k((()=>[A(l,{src:a.appIcon,mode:"widthFix","border-radius":20,width:"160",height:"160"},{error:k((()=>[A(l,{src:a.logoImg,mode:"widthFix",width:"160",height:"160"},null,8,["src"])])),_:1},8,["src"])])),_:1}),A(r,{class:"login-version"},{default:k((()=>[A(r,{class:"login-version-text"},{default:k((()=>[b(w(a.sysConfigInfo.sysVersion||e.define.sysVersion),1)])),_:1})])),_:1})])),_:1}),A(r,{class:"logo-hd u-flex-col"},{default:k((()=>[A(r,{class:"loginSwitch u-flex-col"},{default:k((()=>[I(A(r,{class:"loginInputBox u-flex-col"},{default:k((()=>[A(h,{model:a.formData,rules:a.rules,ref:"dataForm",errorType:["toast"],"label-position":"left","label-width":"150","label-align":"left"},{default:k((()=>[A(d,{prop:"account",borderBottom:!1},{default:k((()=>[A(c,{"input-align":"left",modelValue:a.formData.account,"onUpdate:modelValue":s[0]||(s[0]=e=>a.formData.account=e),placeholder:"请输入帐号",onFocus:i.onFocus,onBlur:i.onBlur,border:"","border-color":"#F0F1F3","placeholder-style":"#9D9D9D"},null,8,["modelValue","onFocus","onBlur"])])),_:1}),A(d,{prop:"password","border-bottom":!1},{default:k((()=>[A(c,{"input-align":"left",modelValue:a.formData.password,"onUpdate:modelValue":s[1]||(s[1]=e=>a.formData.password=e),type:"password",placeholder:"请输入密码",border:"","border-color":"#F0F1F3","placeholder-style":"#9D9D9D"},null,8,["modelValue"])])),_:1}),a.needCode?(y(),p(d,{key:0,prop:"code",required:""},{default:k((()=>[A(r,{class:"u-flex code-box"},{default:k((()=>[A(c,{modelValue:a.formData.code,"onUpdate:modelValue":s[2]||(s[2]=e=>a.formData.code=e),placeholder:"验证码","input-align":"left"},null,8,["modelValue"]),A(r,{class:"code-img-box"},{default:k((()=>[A(l,{showLoading:!0,src:i.baseURL+a.imgUrl,width:"130px",height:"38px",onClick:i.changeCode},null,8,["src","onClick"])])),_:1})])),_:1})])),_:1})):_("",!0)])),_:1},8,["model","rules"]),A(r,{class:"remember-wrap"},{default:k((()=>[A(m,{modelValue:a.remember,"onUpdate:modelValue":s[3]||(s[3]=e=>a.remember=e)},{default:k((()=>[x("span",{class:"remember-text"},"记住账号密码")])),_:1},8,["modelValue"])])),_:1}),A(r,{class:"loginBtnBox"},{default:k((()=>[A(u,{onClick:i.login,type:"primary",loading:a.loading},{default:k((()=>[b(w(a.loading?"登录中...":"登录"),1)])),_:1},8,["onClick","loading"])])),_:1}),a.socialsList.length?(y(),L(F,{key:0},[A(g,{"margin-top":"40","margin-bottom":"40","half-width":"100%"},{default:k((()=>[b("其他登录方式")])),_:1}),A(r,{class:"other-list"},{default:k((()=>[(y(!0),L(F,null,P(a.socialsList,((e,t)=>(y(),L(F,{key:t},["wechat_open"===e.enname?(y(),p(r,{key:0,class:"other-item",title:e.name,onClick:s[4]||(s[4]=e=>i.wechatLogin())},{default:k((()=>[A(Y,{class:T(e.icon)},null,8,["class"])])),_:2},1032,["title"])):"qq"===e.enname?(y(),p(r,{key:1,class:"other-item",title:e.name,onClick:s=>i.otherslogin(e.enname,e.renderUrl)},{default:k((()=>[A(Y,{class:T(e.icon)},null,8,["class"])])),_:2},1032,["title","onClick"])):(y(),p(r,{key:2,class:"other-item",title:e.name,onClick:s=>i.otherslogin(e.enname,e.renderUrl)},{default:k((()=>[A(Y,{class:T(e.icon)},null,8,["class"])])),_:2},1032,["title","onClick"]))],64)))),128))])),_:1})],64)):_("",!0)])),_:1},512),[[U,!a.isSso&&!a.ssoLoading]]),I(A(r,{class:"sso-login-btn"},{default:k((()=>[A(u,{onClick:i.ssoLogin,type:"primary",loading:a.loading},{default:k((()=>[b(w(a.loading?"登录中...":"登录"),1)])),_:1},8,["onClick","loading"])])),_:1},512),[[U,a.isSso&&!a.ssoLoading]])])),_:1})])),_:1}),A(G,{modelValue:a.show,"onUpdate:modelValue":s[5]||(s[5]=e=>a.show=e),mode:"left",width:"90%",height:"100%"},{default:k((()=>[A(r,{class:"mian"},{default:k((()=>[A(r,{class:"top"},{default:k((()=>[A(r,{class:"img-box"},{default:k((()=>[A(n,{class:"img",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAMAAABHPGVmAAAAsVBMVEUAAAAoeP8mdf8oeP8oeP8oeP8oef8oef8oeP8oeP8oev8neP8meP8oeP8oeP8oeP8neP8fef8pef8oeP8oef8oef8oef8neP8mef8neP8lef8gd/8oef8neP8kef8oeP8neP8nev8oeP8oef8oef8oeP8oef8pef////+UvP9fm//y9/9Rkv96rP/K3v9so/+vzf82gf+ixP/k7v/Y5v+91f9Eiv/l7//J3f+HtP+GtP+0Y6GRAAAAJ3RSTlMA+xThjj/z67mpWWc1zcB1WwrIsXqYb2JQSCkPoYgb15tBIPFkPMqM6kSfAAADa0lEQVRo3u2a2XKiUBCGEURwC+57YtZpFgHBNXn/B5sqAzOJffoswEzlwu8SS3+6T280ajdu3KiSh7fWqP7YtO3mY33UenuoXKDj2A24omE7neoUFnULCKz6ogqF/nQAXAbTflmJtgFCjHYpCccCKYxJYWs6A5BmUCwG9BUosdILZMUAFBkoZ45pgTKWqabRqkEBai0VjVcoiEIwO1AYR1ajByXoyWk81aAEtSepFGxAKRoSaakbUBJDnJV3wGGTnveuuz+nG+BwJ9KoA024c/+wC4HmXtCfarQVuUQu49OHvyjorNBF0MbY3GoCFJ7LIAUKXn1ZA0GMBPi2rAsYcgzcjIMX+97Wzdmom9IFgm0ucYQLSX7hDAS/KI05GVjuJ+84DsgQmxMiQyBIGef8ntkGBEOioJA58pkhe/hGdLkYkLnCLi4Tgbdi+IYv8NdE7dh99j2fLpc9IBiwNJaCRIzgiogvAksNM1MV2QpEZmT9pUX2qpbU6SOhawqKOYFIV8M0gH/wbkzEHMUL1ngGmiArIaxSkwDJs7im4N+LGT48AA2eWtsAIn8Fmy/OCvJcpJkikRFwOGQqH9c9LAIOIyRyDxjcT3YfG0j8dEf0E9E8MQaEuDO+A48xEmkCly1LIwIuKzWRxHOZ7EPg0FRyVxy4FOejwF2yB0+YgeJafPAjqeOIUi/2Qy86EXORIIRfxRpRnHwZvf/qbKST0RT5KvKvPwkEHjNlC6TPSYnkkAcZVSARL8zYDbKb9SlX0kNxQ7ZpeQK3p9nnR7JpidvvUfiQENHjal1ykEiFTSPJgsyXGySWZEsMEgDRw9FWMBLldKkf8IDHiRhXu5Jj6hYbggmJY5tIDtw77AlMgvzFG7i1IfvrMfDZMxNySC3S2NmeAB+POfuZkg/YIbpFXmv2JbcSJnvQFrBhiZiCXYGqCCAR/nqlUysgkmCRGncdNcYiOxDgY5GxxkO3cNgIRVChtnT5/WOMyjgv5VX2kCt0i6FUnpzwUEfTX0NJ1n1NyKLsonPxU1a2/275LF6AVL+sbxf11et/eLUx15QwDVDGMDVFlk1QpLnU1Om9gAJWTyvEg4IxQ10rysyQPI3ZD38te2FqA5e7llYFettuEMVwONW16ngb2dZVOA2djlY9+tzJ/77gzHXtxo0bVfIbv+lDdo9C3mIAAAAASUVORK5CYII=",mode:"widthFix"})])),_:1}),A(r,{class:"title"},{default:k((()=>[b(" 请选择登录账号 ")])),_:1})])),_:1}),(y(!0),L(F,null,P(a.tenantUserInfo,((e,s)=>(y(),p(r,{key:s},{default:k((()=>[A(r,{class:"info",onClick:s=>i.socailsLogin(e)},{default:k((()=>[A(r,{class:"user-name"},{default:k((()=>[b(w(e.socialName),1)])),_:2},1024),A(r,{class:"user-tenancy"},{default:k((()=>[b(" 租户名称: "+w(e.tenantName),1)])),_:2},1024),A(r,{class:"user-tenancy"},{default:k((()=>[b(" 租户id:"+w(e.tenantId),1)])),_:2},1024),A(r,{class:"user-tenancy"},{default:k((()=>[b(" 账号:"+w(e.accountName),1)])),_:2},1024)])),_:2},1032,["onClick"])])),_:2},1024)))),128))])),_:1})])),_:1},8,["modelValue"]),a.isKeyUp?(y(),p(r,{key:0,class:"copyright"},{default:k((()=>[b(w(a.copyright),1)])),_:1})):_("",!0)])),_:1})}],["__scopeId","data-v-24f0f044"]]);export{O as default};
|