(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2f2221cc"],{1:function(t,e){},"20ca":function(t,e,o){"use strict";o.d(e,"a",(function(){return s}));const s=(t,e)=>{let o,s=e||300;return function(){let e=arguments;o&&clearTimeout(o);let a=!o;o=setTimeout(()=>{o=null},s),a&&t.apply(this,e)}}},3629:function(t,e,o){"use strict";o.r(e);var s=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("el-dialog",{attrs:{title:t.googleAuthBind?"解绑谷歌验证器":"绑定谷歌验证器",visible:t.visible,"append-to-body":!0},on:{"update:visible":function(e){t.visible=e}}},[o("el-form",{ref:"dataForm",attrs:{model:t.dataForm,rules:t.dataRule,"label-width":"120px"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.dataFormSubmit()}}},[o("div",{staticClass:"gogTop"},[t.getInput?t._e():o("div",{staticClass:"gogRefresgh",on:{click:function(e){return t.getGoogleAuthSecret()}}},[o("i",{staticClass:"el-icon-refresh"})])]),t.getInput&&!t.googleAuthBind?o("el-form-item",{staticStyle:{position:"relative"},attrs:{label:"密钥"}},[o("el-input",{attrs:{type:"number",disabled:!0,placeholder:"请点击右侧 生成密钥和二维码"}}),o("span",{staticClass:"maTreButton",on:{click:function(e){return t.getGoogleAuthSecret()}}},[t._v("生成密钥和二维码")])],1):t._e(),o("el-form-item",{directives:[{name:"show",rawName:"v-show",value:!t.getInput,expression:"!getInput"}],staticStyle:{position:"relative"},attrs:{label:"密钥"}},[o("el-input",{attrs:{type:"text",disabled:!0},model:{value:t.dataForm.secret,callback:function(e){t.$set(t.dataForm,"secret",e)},expression:"dataForm.secret"}}),o("el-button",{directives:[{name:"clipboard",rawName:"v-clipboard:copy",value:t.dataForm.secret,expression:"dataForm.secret",arg:"copy"},{name:"clipboard",rawName:"v-clipboard:success",value:t.onCopy,expression:"onCopy",arg:"success"},{name:"clipboard",rawName:"v-clipboard:error",value:t.onError,expression:"onError",arg:"error"}],staticClass:"spaButton",attrs:{type:"button"}},[t._v(" 复制 ")])],1),o("div",{directives:[{name:"show",rawName:"v-show",value:!t.getInput,expression:"!getInput"}],staticClass:"qrCode"},[o("img",{attrs:{src:t.gleimg,alt:""}})]),t.googleAuthBind?t._e():o("el-form-item",{attrs:{label:"谷歌验证",prop:"code"}},[o("el-input",{attrs:{type:"number",placeholder:"请输入谷歌验证码"},model:{value:t.dataForm.code,callback:function(e){t.$set(t.dataForm,"code",e)},expression:"dataForm.code"}})],1),o("el-form-item",{attrs:{label:"超级谷歌验证码",prop:"rootGoogleAuthCode"}},[o("el-input",{attrs:{type:"number",placeholder:"请输入超级谷歌验证码"},model:{value:t.dataForm.rootGoogleAuthCode,callback:function(e){t.$set(t.dataForm,"rootGoogleAuthCode",e)},expression:"dataForm.rootGoogleAuthCode"}})],1)],1),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.visible=!1}}},[t._v("取消")]),o("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.dataFormSubmit()}}},[t._v("确定")])],1)],1)},a=[],r=o("20ca"),i=(o("90c5"),{data(){return{visible:!1,dataForm:{password:"",newPassword:"",urlencoded:"",rootGoogleAuthCode:"",code:"",secret:""},googleAuthBind:"",getInput:!0,gleimg:"",gogleUs:"",dataRule:{code:[{required:!0,message:"谷歌验证码不能为空",trigger:"blur"}],rootGoogleAuthCode:[{required:!0,message:"超级谷歌验证码不能为空",trigger:"blur"}]},data:{}}},computed:{userName:{get(){return this.$store.state.user.name}},mainTabs:{get(){return this.$store.state.common.mainTabs},set(t){this.$store.commit("common/updateMainTabs",t)}}},created(){console.log(this.googleAuthBind)},methods:{init(t,e,o){this.visible=!0,this.gogleUs=e,this.googleAuthBind=t,this.data={...o},this.$nextTick(()=>{this.getInput=!0,this.$refs["dataForm"].resetFields()})},dataFormSubmit:Object(r["a"])((function(){this.$refs["dataForm"].validate(t=>{t&&(this.googleAuthBind?this.$http({url:this.$http.adornUrl("/sys/user/unbindingGoogleAuth"),method:"post",data:this.$http.adornData({rootGoogleAuthCode:this.dataForm.rootGoogleAuthCode,id:this.gogleUs})}).then(({data:t})=>{this.$message({message:"解绑成功",type:"success",duration:1500,onClose:()=>{this.visible=!1,this.$emit("refreshDataList")}})}):this.$http({url:this.$http.adornUrl("/sys/user/bindGoogleAuth"),method:"post",data:this.$http.adornData({googleAuthCode:this.dataForm.code,id:this.gogleUs,rootGoogleAuthCode:this.dataForm.rootGoogleAuthCode,secret:this.dataForm.secret})}).then(({data:t})=>{0==t.code?this.$message({message:"绑定成功",type:"success",duration:1500,onClose:()=>{this.visible=!1,this.$emit("refreshDataList")}}):this.$message({message:t.msg||"绑定失败",type:"error",duration:1500,onClose:()=>{this.visible=!1,this.$emit("refreshDataList")}})}))})})),getGoogleAuthSecret(){this.$http({url:this.$http.adornUrl("/getLoginGoogleAuthSecret"),method:"get",params:this.$http.adornParams(Object.assign({name:this.data.username||this.data.userName}))}).then(({data:t})=>{0==t.code?(this.getInput=!1,this.dataForm.secret=t.data.googleAuthSecret,this.gleimg=t.data.googleAuthImg,this.$message({message:"操作成功",type:"success",duration:1500})):this.$message({message:"生成失败",type:"error",duration:1500})})},onCopy:function(t){this.$message({message:"复制成功",type:"success"})},onError:function(t){this.$message({message:"复制失败",type:"error"})}}}),n=i,l=(o("424b"),o("2877")),u=Object(l["a"])(n,s,a,!1,null,"72af8c5c",null);e["default"]=u.exports},"424b":function(t,e,o){"use strict";o("75f0")},"75f0":function(t,e,o){},"90c5":function(t,e,o){"use strict";o.d(e,"a",(function(){return i}));var s=o("3452"),a=o.n(s);const r="-mall4j-password";function i(t){const e=Date.now(),o=a.a.enc.Utf8.parse(r),s=a.a.enc.Utf8.parse(e+t),i=a.a.AES.encrypt(s,o,{mode:a.a.mode.ECB,padding:a.a.pad.Pkcs7});return i.toString()}}}]);