1 line
6.6 KiB
JavaScript
1 line
6.6 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["generator"],{2728:function(t,e,s){},"390f":function(t,e,s){"use strict";var a=s("2728"),n=s.n(a);n.a},"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("d780"),s("b54b")),r=s("08c1"),o=s("36f0"),c=s("c0b7"),l=s("e6a3"),d=s("bfd3"),m={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["a"])({},Object(r["c"])(["user_infos","row_data","row_pwd","settings"])),methods:Object(i["a"])({},Object(r["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(d["a"].call(this),0!=Object.keys(this.row_pwd).length){var 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(c["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="".concat(document.documentElement.clientHeight),window.onresize=function(){this.clientHeight="".concat(document.documentElement.clientHeight),Object(l["a"])()}.bind(this)},watch:{clientHeight:function(){this.changeFixed(this.clientHeight)}},beforeDestroy(){},components:{}},h=m,u=(s("390f"),s("623f")),_=Object(u["a"])(h,a,n,!1,null,"42d98e28",null);e["default"]=_.exports},c0b7:function(t,e,s){"use strict";s.d(e,"a",(function(){return c}));s("c1f4");var a={lower:n,upper:i,number:r,symbol:o};function n(){return String.fromCharCode(Math.floor(26*Math.random())+97)}function i(){return String.fromCharCode(Math.floor(26*Math.random())+65)}function r(){return String.fromCharCode(Math.floor(10*Math.random())+48)}function o(){var t='~!@#$%^&*()_+{}":?><;.,';return t[Math.floor(Math.random()*t.length)]}function c(t,e,s,n,i){var r="",o=e+s+n+i,c=[{lower:e},{upper:s},{number:n},{symbol:i}].filter(t=>Object.values(t)[0]);if(0===o)return"";for(var l=0;l<t;l++)c.forEach(t=>{var e=Object.keys(t)[0];r+=a[e]()});return r.slice(0,t)}},c1f4:function(t,e,s){"use strict";var a=s("91fe"),n=s("d68d"),i=s("a8c9"),r=s("0192"),o=s("684e"),c=s("8c47"),l=s("01d7"),d=s("57c4"),m=s("b1a1"),h=s("6885"),u=m("slice"),_=h("slice",{ACCESSORS:!0,0:0,1:2}),p=d("species"),g=[].slice,v=Math.max;a({target:"Array",proto:!0,forced:!u||!_},{slice:function(t,e){var s,a,d,m=c(this),h=o(m.length),u=r(t,h),_=r(void 0===e?h:e,h);if(i(m)&&(s=m.constructor,"function"!=typeof s||s!==Array&&!i(s.prototype)?n(s)&&(s=s[p],null===s&&(s=void 0)):s=void 0,s===Array||void 0===s))return g.call(m,u,_);for(a=new(void 0===s?Array:s)(v(_-u,0)),d=0;u<_;u++,d++)u in m&&l(a,d,m[u]);return a.length=d,a}})}}]); |