x-php-Admin/dist/static/js/218.cdfbcbf0.js
2024-01-27 23:50:54 +08:00

1 line
4.7 KiB
JavaScript

"use strict";(self["webpackChunkx_php_admin"]=self["webpackChunkx_php_admin"]||[]).push([[218],{6218:function(o,e,t){t.r(e),t.d(e,{default:function(){return N}});var i=t(6808),a=t(9511);const s=o=>((0,i.dD)("data-v-49c93e12"),o=o(),(0,i.Cn)(),o),n={class:"login_bg"},l={class:"login_adv",style:{"background-image":"url(https://x-mo.cn:8888/background)"}},c=s((()=>(0,i._)("div",{class:"login_adv__title"},null,-1))),d=s((()=>(0,i._)("div",{class:"login_adv__mask"},null,-1))),r={class:"login_adv__bottom"},g={href:"https://x-php.com",target:"_blank"},h={class:"login_main"},u={class:"login_config"},m={class:"login-form"},_={class:"login-header"},p={class:"logo"},f=["alt","src"],v=s((()=>(0,i._)("span",{class:"login-right-warp-one"},null,-1))),w=s((()=>(0,i._)("span",{class:"login-right-warp-two"},null,-1))),L={class:"login-oauth"},$={class:"qrCodeLogin"},k=s((()=>(0,i._)("p",{class:"msg"},"请使用微信扫一扫登录",-1))),W={key:0,class:"qrCodeLogin-result"};function A(o,e,t,s,A,P){const b=(0,i.up)("el-button"),q=(0,i.up)("password-form"),C=(0,i.up)("el-tab-pane"),y=(0,i.up)("el-tabs"),E=(0,i.up)("el-divider"),N=(0,i.up)("el-dialog"),x=(0,i.up)("x-qr-code"),D=(0,i.up)("el-result");return(0,i.wg)(),(0,i.iD)(i.HY,null,[(0,i._)("div",n,[(0,i._)("div",l,[c,d,(0,i._)("div",r,[(0,i._)("a",g,"© "+(0,a.zw)(o.$config.APP_NAME)+" "+(0,a.zw)(o.$config.APP_VER),1)])]),(0,i._)("div",h,[(0,i.Wm)(N,{modelValue:A.open,"onUpdate:modelValue":e[0]||(e[0]=o=>A.open=o),modal:!1,"show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},{default:(0,i.w5)((()=>[(0,i._)("div",u,[(0,i.Wm)(b,{icon:A.config.dark?"el-icon-sunny":"el-icon-moon",circle:"",type:"info",onClick:P.configDark},null,8,["icon","onClick"])]),(0,i._)("div",m,[(0,i._)("div",_,[(0,i._)("div",p,[(0,i._)("img",{alt:o.$config.APP_NAME,src:A.appLogo},null,8,f),(0,i._)("label",null,(0,a.zw)(o.$config.APP_NAME),1)])]),(0,i.Wm)(y,null,{default:(0,i.w5)((()=>[(0,i.Wm)(C,{label:"登录",lazy:""},{default:(0,i.w5)((()=>[v,w,(0,i.Wm)(q)])),_:1})])),_:1}),o.$config.MY_SHOW_LOGIN_OAUTH?((0,i.wg)(),(0,i.iD)(i.HY,{key:0},[(0,i.Wm)(E,null,{default:(0,i.w5)((()=>[(0,i.Uk)("其它登录")])),_:1}),(0,i._)("div",L,[(0,i.Wm)(b,{type:"success",icon:"x-icon-wechat",circle:"",onClick:P.wechatLogin},null,8,["onClick"])])],64)):(0,i.kq)("",!0)])])),_:1},8,["modelValue"])])]),(0,i.Wm)(N,{modelValue:A.showWechatLogin,"onUpdate:modelValue":e[1]||(e[1]=o=>A.showWechatLogin=o),title:"微信登录",width:400,"destroy-on-close":""},{default:(0,i.w5)((()=>[(0,i._)("div",$,[(0,i.Wm)(x,{class:"qrCode",text:A.WechatLoginCode,size:200},null,8,["text"]),k,A.isWechatLoginResult?((0,i.wg)(),(0,i.iD)("div",W,[(0,i.Wm)(D,{icon:"success",title:"已扫描","sub-title":"请在设备中点击授权登录"})])):(0,i.kq)("",!0)])])),_:1},8,["modelValue"])],64)}var P=t(7126),b=t(8428),q=t(5080),C={components:{passwordForm:P["default"],phoneForm:b["default"]},data(){return{config:{lang:this.$tool.data.get("APP_LANG")||this.$config.LANG,dark:this.$tool.data.get("APP_DARK")||!1},lang:[{name:"简体中文",value:"zh-cn"},{name:"English",value:"en"}],WechatLoginCode:"",WechatLoginuniqid:"",appLogo:"",showWechatLogin:!1,isWechatLoginResult:!1,open:!0}},watch:{"config.dark"(o){o?(document.documentElement.classList.add("dark"),this.$tool.data.set("APP_DARK",o)):(document.documentElement.classList.remove("dark"),this.$tool.data.remove("APP_DARK"))}},created:function(){this.appLogo=this.$tool.data.get("appLogo")||this.$config.APP_LOGO||q,this.$tool.cookie.remove(this.$config.SESSIONNAME),this.$tool.data.remove("user"),this.$tool.data.remove("menu"),this.$tool.data.remove("permissions"),this.$tool.data.remove("dashboardgrid"),this.$tool.data.remove("grid"),this.$tool.store.remove("token"),this.$store.commit("clearViewTags"),this.$store.commit("clearKeepLive"),this.$store.commit("clearIframeList")},methods:{configDark(){this.config.dark=!this.config.dark},long_contact:function(){if(!this.WechatLoginuniqid)return!1;setTimeout((async()=>{var o=await this.$http.post("login/wechatSubmit",{uniqid:this.WechatLoginuniqid});if(201==o.code)this.showWechatLogin=!1,this.$message.warning(o.message);else if(202==o.code)this.long_contact();else if(200==o.code){this.showWechatLogin=!1,this.$tool.cookie.set(this.$config.SESSIONNAME,o.data.token,{expires:31104e3});const e=this.$route.query.redirect||"/";return this.$router.replace({path:e}),this.$message.success("Login Success 登录成功"),this.islogin=!1,!1}}),1e3)},async wechatLogin(){var o=await this.$http.get("login/wechatQrcode");if(200!=o.code)return this.$message.warning(o.message),!1;this.showWechatLogin=!0,this.WechatLoginCode=o.data.qrcodeurl,this.WechatLoginuniqid=o.data.uniqid,this.long_contact()}}},y=t(8700);const E=(0,y.Z)(C,[["render",A],["__scopeId","data-v-49c93e12"]]);var N=E}}]);