x-php-Admin/dist/static/js/798.4ad58f24.js

1 line
4.4 KiB
JavaScript

"use strict";(self["webpackChunkx_php_admin"]=self["webpackChunkx_php_admin"]||[]).push([[798],{798:function(t,o,e){e.r(o),e.d(o,{default:function(){return C}});var i=e(6252),a=e(3577);const s=t=>((0,i.dD)("data-v-568968a7"),t=t(),(0,i.Cn)(),t),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"},[(0,i._)("h2",null,"X-PHP"),(0,i._)("p",null,"以优雅的代码,打造精致的应用。高性能 / 精致 / 优雅")],-1))),d=s((()=>(0,i._)("div",{class:"login_adv__mask"},null,-1))),r={class:"login_adv__bottom"},g={class:"login_main"},h={class:"login_config"},u={class:"login-form"},m={class:"login-header"},_={class:"logo"},p=["alt","src"],f={class:"login-oauth"},v={class:"qrCodeLogin"},w=s((()=>(0,i._)("p",{class:"msg"},"请使用微信扫一扫登录 | 模拟3秒后自动扫描",-1))),L={key:0,class:"qrCodeLogin-result"};function $(t,o,e,s,$,k){const W=(0,i.up)("el-button"),A=(0,i.up)("password-form"),P=(0,i.up)("el-tab-pane"),b=(0,i.up)("el-tabs"),q=(0,i.up)("el-divider"),C=(0,i.up)("x-qr-code"),y=(0,i.up)("el-result"),E=(0,i.up)("el-dialog");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,a.zw)(t.$config.APP_NAME)+" "+(0,a.zw)(t.$config.APP_VER),1)]),(0,i._)("div",g,[(0,i._)("div",h,[(0,i.Wm)(W,{icon:$.config.dark?"el-icon-sunny":"el-icon-moon",circle:"",type:"info",onClick:k.configDark},null,8,["icon","onClick"])]),(0,i._)("div",u,[(0,i._)("div",m,[(0,i._)("div",_,[(0,i._)("img",{alt:t.$config.APP_NAME,src:$.appLogo},null,8,p),(0,i._)("label",null,(0,a.zw)(t.$config.APP_NAME),1)])]),(0,i.Wm)(b,null,{default:(0,i.w5)((()=>[(0,i.Wm)(P,{label:"登录",lazy:""},{default:(0,i.w5)((()=>[(0,i.Wm)(A)])),_:1})])),_:1}),t.$config.MY_SHOW_LOGIN_OAUTH?((0,i.wg)(),(0,i.iD)(i.HY,{key:0},[(0,i.Wm)(q,null,{default:(0,i.w5)((()=>[(0,i.Uk)("其它登录")])),_:1}),(0,i._)("div",f,[(0,i.Wm)(W,{type:"success",icon:"x-icon-wechat",circle:"",onClick:k.wechatLogin},null,8,["onClick"])])],64)):(0,i.kq)("",!0)])])]),(0,i.Wm)(E,{modelValue:$.showWechatLogin,"onUpdate:modelValue":o[0]||(o[0]=t=>$.showWechatLogin=t),title:"微信登录",width:400,"destroy-on-close":""},{default:(0,i.w5)((()=>[(0,i._)("div",v,[(0,i.Wm)(C,{class:"qrCode",text:$.WechatLoginCode,size:200},null,8,["text"]),w,$.isWechatLoginResult?((0,i.wg)(),(0,i.iD)("div",L,[(0,i.Wm)(y,{icon:"success",title:"已扫描","sub-title":"请在设备中点击授权登录"})])):(0,i.kq)("",!0)])])),_:1},8,["modelValue"])],64)}var k=e(6874),W=e(2247),A=e(5080),P={components:{passwordForm:k["default"],phoneForm:W["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}},watch:{"config.dark"(t){t?(document.documentElement.classList.add("dark"),this.$tool.data.set("APP_DARK",t)):(document.documentElement.classList.remove("dark"),this.$tool.data.remove("APP_DARK"))}},created:function(){this.appLogo=this.$tool.data.get("appLogo")||this.$config.APP_LOGO||A,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 t=await this.$http.post("login/wechatSubmit",{uniqid:this.WechatLoginuniqid});if(201==t.code)this.showWechatLogin=!1,this.$message.warning(t.message);else if(202==t.code)this.long_contact();else if(200==t.code){this.showWechatLogin=!1,this.$tool.cookie.set(this.$config.SESSIONNAME,t.data.token,{expires:31104e3});const o=this.$route.query.redirect||"/";return this.$router.replace({path:o}),this.$message.success("Login Success 登录成功"),this.islogin=!1,!1}}),1e3)},async wechatLogin(){var t=await this.$http.get("login/wechatQrcode");if(200!=t.code)return this.$message.warning(t.message),!1;this.showWechatLogin=!0,this.WechatLoginCode=t.data.qrcodeurl,this.WechatLoginuniqid=t.data.uniqid,this.long_contact()}}},b=e(3744);const q=(0,b.Z)(P,[["render",$],["__scopeId","data-v-568968a7"]]);var C=q}}]);