1 line
5.9 KiB
JavaScript
1 line
5.9 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["generator"],{3608:function(t,e,s){},"5eac":function(t,e,s){"use strict";s.r(e);var a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"account"},[s("md-app",{attrs:{"md-waterfall":"","md-mode":"fixed"}},[s("md-app-toolbar",{staticClass:"md-primary toolbar"},[s("div",{staticClass:"md-toolbar-section-start"},[s("md-button",{staticClass:"md-icon-button",on:{click:function(e){return t.back()}}},[s("md-icon",[t._v("arrow_back")])],1),s("h3",{staticClass:"md-title",staticStyle:{flex:"1"}},[t._v(t._s(t.lang.title))])],1)]),s("md-app-content",[s("v-touch",{attrs:{"swipe-options":{direction:"horizontal"}},on:{swiperight:function(e){return t.back()}}},[s("div",{ref:"list_placeholder",staticStyle:{height:"54px"}}),s("md-list",[s("md-subheader",{staticClass:"md-primary"},[t._v(t._s(t.lang.subheader[0]))]),s("md-list-item",[s("p",{directives:[{name:"clipboard",rawName:"v-clipboard:copy",value:t.code_res,expression:"code_res",arg:"copy"},{name:"clipboard",rawName:"v-clipboard:success",value:t.onCopyCode,expression:"onCopyCode",arg:"success"},{name:"clipboard",rawName:"v-clipboard:error",value:t.onErrorCode,expression:"onErrorCode",arg:"error"}]},[t._v(t._s(t.code_res?t.code_res:t.lang.code_res_empty))])]),s("md-subheader",{staticClass:"md-primary"},[t._v(t._s(t.lang.subheader[1]))]),s("md-list-item",[s("md-field",[s("label",{attrs:{for:"expired_time"}},[t._v(t._s(t.lang.length_setter.label))]),s("md-select",{attrs:{name:"code_length",id:"code_length"},model:{value:t.code_length,callback:function(e){t.code_length=e},expression:"code_length"}},[s("md-option",{attrs:{value:"6"}},[t._v(t._s(t.lang.length_setter.options[0]))]),s("md-option",{attrs:{value:"12"}},[t._v(t._s(t.lang.length_setter.options[1]))]),s("md-option",{attrs:{value:"18"}},[t._v(t._s(t.lang.length_setter.options[2]))]),s("md-option",{attrs:{value:"24"}},[t._v(t._s(t.lang.length_setter.options[3]))]),s("md-option",{attrs:{value:"32"}},[t._v(t._s(t.lang.length_setter.options[4]))])],1)],1)],1),s("md-list-item",[s("span",{staticClass:"md-list-item-text"},[t._v(t._s(t.lang.settings[0]))]),s("md-switch",{staticClass:"md-primary",model:{value:t.have_upper,callback:function(e){t.have_upper=e},expression:"have_upper"}})],1),s("md-list-item",[s("span",{staticClass:"md-list-item-text"},[t._v(t._s(t.lang.settings[1]))]),s("md-switch",{staticClass:"md-primary",model:{value:t.have_lower,callback:function(e){t.have_lower=e},expression:"have_lower"}})],1),s("md-list-item",[s("span",{staticClass:"md-list-item-text"},[t._v(t._s(t.lang.settings[2]))]),s("md-switch",{staticClass:"md-primary",model:{value:t.have_num,callback:function(e){t.have_num=e},expression:"have_num"}})],1),s("md-list-item",[s("span",{staticClass:"md-list-item-text"},[t._v(t._s(t.lang.settings[3]))]),s("md-switch",{staticClass:"md-primary",model:{value:t.have_symbol,callback:function(e){t.have_symbol=e},expression:"have_symbol"}})],1),s("md-button",{staticClass:"md-raised md-primary expand",on:{click:function(e){return t.generateStart()}}},[t._v(t._s(t.lang.submit))])],1),s("md-snackbar",{attrs:{"md-position":"center","md-active":t.show_snackbar,"md-persistent":""},on:{"update:mdActive":function(e){t.show_snackbar=e},"update:md-active":function(e){t.show_snackbar=e}}},[s("span",[t._v(t._s(t.snakebar_msg))])])],1)],1)],1)],1)},n=[],i=(s("9b42"),s("cf6b")),o=s("36f0"),r=s("c0b7"),l=s("e6a3"),c=s("bfd3"),d={name:"Add",data(){return{show_snackbar:!1,snakebar_msg:"",lang:"",clientHeight:"",have_upper:!0,have_lower:!0,have_num:!0,have_symbol:!1,code_length:12,code_res:""}},computed:{...Object(i["c"])(["user_infos","row_data","row_pwd","settings"])},methods:{...Object(i["b"])(["setUserInfo","setRowData","setRowPwd","setSettings"]),changeFixed(t){this.$refs.list_placeholder.parentNode.parentNode.style.maxHeight=t+"px",this.$refs.list_placeholder.parentNode.style.minHeight=t-32+"px",window.document.documentElement.setAttribute("data-theme",this.settings.is_dark_mode?"dark":"light")},init(){if(c["a"].call(this),0!=Object.keys(this.row_pwd).length){let t=(new Date).getTime();t-this.row_pwd.create_time<this.settings.expired_time?this.initLanguage():this.turnToHome("密码超时")}else this.turnToHome("无密码")},initLanguage(){this.settings.is_chinese?this.lang=Object(o["a"])().generator.CHS:this.lang=Object(o["a"])().generator.EN,console.log("语言配置完成")},back(){this.$router.go(-1)},turnToHome(t){console.log(t),this.$router.replace("/")},generateStart(){this.code_res=Object(r["a"])(this.code_length,this.have_lower,this.have_upper,this.have_num,this.have_symbol),this.snakebar_msg=this.lang.generate_successful,this.show_snackbar=!0},onCopyCode(){this.snakebar_msg=this.lang.copy_successful,this.show_snackbar=!0},onErrorCode(){this.snakebar_msg=this.lang.copy_failed,this.show_snackbar=!0}},created(){this.lang=Object(o["a"])().generator.CHS,console.log("临时语言系统加载完成"),this.init()},mounted(){this.clientHeight=""+document.documentElement.clientHeight,window.onresize=function(){this.clientHeight=""+document.documentElement.clientHeight,Object(l["a"])()}.bind(this)},watch:{clientHeight:function(){this.changeFixed(this.clientHeight)}},beforeDestroy(){},components:{}},m=d,h=(s("7ddd"),s("5d22")),_=Object(h["a"])(m,a,n,!1,null,"7f12830a",null);e["default"]=_.exports},"7ddd":function(t,e,s){"use strict";s("3608")},c0b7:function(t,e,s){"use strict";s.d(e,"a",(function(){return l}));const a={lower:n,upper:i,number:o,symbol:r};function n(){return String.fromCharCode(Math.floor(26*Math.random())+97)}function i(){return String.fromCharCode(Math.floor(26*Math.random())+65)}function o(){return String.fromCharCode(Math.floor(10*Math.random())+48)}function r(){const t='~!@#$%^&*()_+{}":?><;.,';return t[Math.floor(Math.random()*t.length)]}function l(t,e,s,n,i){let o="";const r=e+s+n+i,l=[{lower:e},{upper:s},{number:n},{symbol:i}].filter(t=>Object.values(t)[0]);if(0===r)return"";for(let c=0;c<t;c++)l.forEach(t=>{const e=Object.keys(t)[0];o+=a[e]()});return o.slice(0,t)}}}]); |