1 line
10 KiB
JavaScript
1 line
10 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["add"],{"3bad":function(t,e,a){var s=a("91fe"),i=a("9817").values;s({target:"Object",stat:!0},{values:function(t){return i(t)}})},"8c18":function(t,e,a){},"94ec":function(t,e,a){"use strict";var s=a("91fe"),i=a("03fa").trim,n=a("b680");s({target:"String",proto:!0,forced:n("trim")},{trim:function(){return i(this)}})},9817:function(t,e,a){var s=a("7a23"),i=a("16e5"),n=a("8c47"),r=a("354c").f,o=function(t){return function(e){var a,o=n(e),d=i(o),c=d.length,l=0,u=[];while(c>l)a=d[l++],s&&!r.call(o,a)||u.push(t?[a,o[a]]:o[a]);return u}};t.exports={entries:o(!0),values:o(!1)}},b680:function(t,e,a){var s=a("f30e"),i=a("2d82"),n="
";t.exports=function(t){return s((function(){return!!i[t]()||n[t]()!=n||i[t].name!==t}))}},c0b7:function(t,e,a){"use strict";a.d(e,"a",(function(){return d}));a("86dd"),a("af82"),a("c1f4"),a("79dd"),a("3bad"),a("9a14");var s={lower:i,upper:n,number:r,symbol:o};function i(){return String.fromCharCode(Math.floor(26*Math.random())+97)}function n(){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 d(t,e,a,i,n){var r="",o=e+a+i+n,d=[{lower:e},{upper:a},{number:i},{symbol:n}].filter((function(t){return Object.values(t)[0]}));if(0===o)return"";for(var c=0;c<t;c++)d.forEach((function(t){var e=Object.keys(t)[0];r+=s[e]()}));return r.slice(0,t)}},df8f:function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"add"},[a("md-app",{attrs:{"md-waterfall":"","md-mode":"fixed"}},[a("md-app-toolbar",{staticClass:"md-primary toolbar"},[a("div",{staticClass:"md-toolbar-section-start"},[a("md-button",{staticClass:"md-icon-button",on:{click:function(e){return t.back()}}},[a("md-icon",[t._v("arrow_back")])],1),a("h3",{staticClass:"md-title",staticStyle:{flex:"1"}},[t._v(t._s(t.id_cache?t.lang.title[1]:t.lang.title[0]))])],1)]),a("md-app-content",[a("v-touch",{attrs:{"swipe-options":{direction:"horizontal"}},on:{swiperight:function(e){return t.back()}}},[a("div",{ref:"list_placeholder",staticStyle:{height:"54px"}}),a("md-field",{class:t.title_verify?"":"md-invalid"},[a("label",[t._v(t._s(t.lang.subheader[0]))]),a("md-input",{attrs:{required:""},model:{value:t.title,callback:function(e){t.title=e},expression:"title"}}),a("span",{staticClass:"md-error"},[t._v(t._s(t.lang.empty_error[0]))])],1),a("md-field",{class:t.user_name_verify?"":"md-invalid"},[a("label",[t._v(t._s(t.lang.subheader[1]))]),a("md-input",{attrs:{required:""},model:{value:t.user_name,callback:function(e){t.user_name=e},expression:"user_name"}}),a("span",{staticClass:"md-error"},[t._v(t._s(t.lang.empty_error[1]))])],1),a("md-field",{class:t.password_verify?"":"md-invalid"},[a("label",[t._v(t._s(t.lang.subheader[2]))]),a("md-input",{attrs:{required:""},model:{value:t.password,callback:function(e){t.password=e},expression:"password"}}),a("span",{staticClass:"md-error"},[t._v(t._s(t.lang.empty_error[2]))]),a("span",{staticClass:"md-caption",staticStyle:{color:"#448AFF"},on:{click:function(e){t.show_dialog=!0}}},[t._v("生成密码")])],1),a("md-field",[a("label",[t._v(t._s(t.lang.subheader[3]))]),a("md-input",{model:{value:t.web_address,callback:function(e){t.web_address=e},expression:"web_address"}})],1),a("md-field",[a("label",[t._v(t._s(t.lang.subheader[4]))]),a("md-textarea",{model:{value:t.node,callback:function(e){t.node=e},expression:"node"}})],1),a("md-button",{staticClass:"md-raised md-primary expand",on:{click:function(e){return t.judgeContent()}}},[t._v(t._s(t.lang.enter))]),a("md-dialog",{staticStyle:{"min-width":"50%"},attrs:{"md-active":t.show_dialog},on:{"update:mdActive":function(e){t.show_dialog=e},"update:md-active":function(e){t.show_dialog=e}}},[a("md-dialog-title",[t._v("生成密码"+t._s(t.copy_state))]),a("md-list",[a("md-subheader",{staticClass:"md-primary"},[t._v(t._s(t.lang.generator.subheader[0]))]),a("md-list-item",[a("p",[t._v(t._s(t.password?t.password:t.lang.generator.code_res_empty))])]),a("md-subheader",{staticClass:"md-primary"},[t._v(t._s(t.lang.generator.subheader[1]))]),a("md-list-item",[a("md-field",[a("label",{attrs:{for:"expired_time"}},[t._v(t._s(t.lang.generator.length_setter.label))]),a("md-select",{attrs:{name:"code_length",id:"code_length"},model:{value:t.code_length,callback:function(e){t.code_length=e},expression:"code_length"}},[a("md-option",{attrs:{value:"6"}},[t._v(t._s(t.lang.generator.length_setter.options[0]))]),a("md-option",{attrs:{value:"12"}},[t._v(t._s(t.lang.generator.length_setter.options[1]))]),a("md-option",{attrs:{value:"18"}},[t._v(t._s(t.lang.generator.length_setter.options[2]))]),a("md-option",{attrs:{value:"24"}},[t._v(t._s(t.lang.generator.length_setter.options[3]))]),a("md-option",{attrs:{value:"32"}},[t._v(t._s(t.lang.generator.length_setter.options[4]))])],1)],1)],1),a("md-list-item",[a("span",{staticClass:"md-list-item-text"},[t._v(t._s(t.lang.generator.settings[0]))]),a("md-switch",{staticClass:"md-primary",model:{value:t.have_upper,callback:function(e){t.have_upper=e},expression:"have_upper"}})],1),a("md-list-item",[a("span",{staticClass:"md-list-item-text"},[t._v(t._s(t.lang.generator.settings[1]))]),a("md-switch",{staticClass:"md-primary",model:{value:t.have_lower,callback:function(e){t.have_lower=e},expression:"have_lower"}})],1),a("md-list-item",[a("span",{staticClass:"md-list-item-text"},[t._v(t._s(t.lang.generator.settings[2]))]),a("md-switch",{staticClass:"md-primary",model:{value:t.have_num,callback:function(e){t.have_num=e},expression:"have_num"}})],1),a("md-list-item",[a("span",{staticClass:"md-list-item-text"},[t._v(t._s(t.lang.generator.settings[3]))]),a("md-switch",{staticClass:"md-primary",model:{value:t.have_symbol,callback:function(e){t.have_symbol=e},expression:"have_symbol"}})],1)],1),a("md-dialog-actions",[a("md-button",{staticClass:"md-primary",on:{click:function(e){return t.generateStart()}}},[t._v(t._s(t.lang.generator.actions[0]))]),a("md-button",{directives:[{name:"clipboard",rawName:"v-clipboard:copy",value:t.password,expression:"password",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"}],staticClass:"md-primary"},[t._v(t._s(t.lang.generator.actions[1]))]),a("md-button",{staticClass:"md-primary",on:{click:function(e){t.show_dialog=!1}}},[t._v(t._s(t.lang.generator.actions[2]))])],1)],1)],1)],1)],1)],1)},i=[],n=(a("79dd"),a("3a20"),a("b3f9"),a("7267"),a("d780"),a("94ec"),a("b54b")),r=a("08c1"),o=a("c71e"),d=a("36f0"),c=a("e6a3"),l=a("c0b7"),u=a("bfd3"),m={name:"Add",data:function(){return{clientHeight:"",title:"",user_name:"",password:"",node:"",web_address:"",id_cache:"",open_count_cache:"",title_verify:!0,user_name_verify:!0,password_verify:!0,lang:"",show_dialog:!1,have_upper:!0,have_lower:!0,have_num:!0,have_symbol:!1,code_length:12,copy_state:""}},computed:Object(n["a"])({},Object(r["c"])(["row_data","row_pwd","settings","user_infos"])),methods:Object(n["a"])({},Object(r["b"])(["setRowData","setRowPwd","setSettings","setUserInfo"]),{changeFixed:function(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:function(){if(u["a"].call(this),0!=Object.keys(this.row_pwd).length){var t=(new Date).getTime();if(t-this.row_pwd.create_time<this.settings.expired_time){if(this.initLanguage(),this.$route.params.modify_content){var e=this.$route.params.modify_content;this.title=e.title,this.user_name=e.user_name,this.password=e.password,this.node=e.node,this.web_address=e.web_address,this.id_cache=e.id,this.open_count_cache=e.open_count}return}this.turnToHome("密码超时")}else this.turnToHome("无密码")},initLanguage:function(){this.settings.is_chinese?this.lang=Object(d["a"])().add.CHS:this.lang=Object(d["a"])().add.EN,console.log("语言配置完成")},judgeContent:function(){var t=!0;(this.title=this.title.trim())||(t=!1,this.title_verify=!1),(this.user_name=this.user_name.trim())||(t=!1,this.user_name_verify=!1),(this.password=this.password.trim())||(t=!1,this.password_verify=!1),t&&this.submit()},submit:function(){if(this.id_cache)return console.log("覆写拦截器生效"),void this.reWrite();var t,e={id:this.createId(),open_count:0,title:this.title,user_name:this.user_name,password:this.password,node:this.node,web_address:this.web_address},a=Object(o["b"])(this.row_pwd.main_code);if(this.row_data){var s=Object(o["a"])(a,this.row_data);t=JSON.parse(s),t.push(e)}else t=[e];var i=Object(o["c"])(a,t);this.setRowData([i,this]),console.log("新加密信息保存成功,返回Home"),this.back()},reWrite:function(){var t,e={id:this.id_cache,open_count:this.open_count_cache,title:this.title,user_name:this.user_name,password:this.password,node:this.node,web_address:this.web_address},a=Object(o["b"])(this.row_pwd.main_code),s=Object(o["a"])(a,this.row_data);for(var i in t=JSON.parse(s),t)t[i].id==e.id&&(t[i]=e);var n=Object(o["c"])(a,t);this.setRowData([n,this]),console.log("新加密信息覆写成功,返回详情"),this.back()},back:function(){this.$router.go(-1)},turnToHome:function(t){console.log(t),this.$router.replace("/")},createId:function(){var t=(new Date).getTime(),e=Math.floor(100*Math.random());e=e<10?"0"+e.toString():e.toString();var a=t.toString()+e;return a},generateStart:function(){this.password=Object(l["a"])(this.code_length,this.have_lower,this.have_upper,this.have_num,this.have_symbol)},onCopyCode:function(){var t=this;this.copy_state=this.lang.generator.copy_successful,setTimeout((function(){t.copy_state=""}),2e3)},onErrorCode:function(){var t=this;this.copy_state=this.lang.generator.copy_failed,setTimeout((function(){t.copy_state=""}),2e3)}}),created:function(){this.lang=Object(d["a"])().add.CHS,console.log("临时语言系统加载完成"),this.init()},mounted:function(){this.clientHeight="".concat(document.documentElement.clientHeight),window.onresize=function(){this.clientHeight="".concat(document.documentElement.clientHeight),Object(c["a"])()}.bind(this)},watch:{clientHeight:function(){this.changeFixed(this.clientHeight)}},beforeDestroy:function(){},components:{}},h=m,_=(a("e2ca"),a("623f")),p=Object(_["a"])(h,s,i,!1,null,"5b047d15",null);e["default"]=p.exports},e2ca:function(t,e,a){"use strict";var s=a("8c18"),i=a.n(s);i.a}}]); |