← Back
Editing: add-redirect-legacy2.js
!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}var e=["type","holdpath"];function r(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */r=function(){return n};var e,n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},l=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(e){s=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),u=new G(n||[]);return a(i,"_invoke",{value:S(t,r,u)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var d="suspendedStart",y="suspendedYield",m="executing",v="completed",g={};function b(){}function w(){}function j(){}var O={};s(O,l,(function(){return this}));var x=Object.getPrototypeOf,L=x&&x(x(N([])));L&&L!==o&&i.call(L,l)&&(O=L);var E=j.prototype=b.prototype=Object.create(O);function _(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function P(e,r){function n(o,a,u,l){var c=h(e[o],e,a);if("throw"!==c.type){var f=c.arg,s=f.value;return s&&"object"==t(s)&&i.call(s,"__await")?r.resolve(s.__await).then((function(t){n("next",t,u,l)}),(function(t){n("throw",t,u,l)})):r.resolve(s).then((function(t){f.value=t,u(f)}),(function(t){return n("throw",t,u,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(i,i):i()}})}function S(t,r,n){var o=d;return function(i,a){if(o===m)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var l=k(u,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var c=h(t,r,n);if("normal"===c.type){if(o=n.done?v:y,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=v,n.method="throw",n.arg=c.arg)}}}function k(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,k(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function V(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function U(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(V,this),this.reset(!0)}function N(r){if(r||""===r){var n=r[l];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function t(){for(;++o<r.length;)if(i.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(t(r)+" is not iterable")}return w.prototype=j,a(E,"constructor",{value:j,configurable:!0}),a(j,"constructor",{value:w,configurable:!0}),w.displayName=s(j,f,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,j):(t.__proto__=j,s(t,f,"GeneratorFunction")),t.prototype=Object.create(E),t},n.awrap=function(t){return{__await:t}},_(P.prototype),s(P.prototype,c,(function(){return this})),n.AsyncIterator=P,n.async=function(t,e,r,o,i){void 0===i&&(i=Promise);var a=new P(p(t,e,r,o),i);return n.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(E),s(E,f,"Generator"),s(E,l,(function(){return this})),s(E,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=N,G.prototype={constructor:G,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(U),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var l=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),U(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;U(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},n}function n(t,e,r,n,o,i,a){try{var u=t[i](a),l=u.value}catch(t){return void r(t)}u.done?e(l):Promise.resolve(l).then(n,o)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(e,r,n){return(r=function(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==t(r)?r:r+""}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}System.register(["./utils-lib-legacy.js?v=VERSION_NUMBER","./base-lib-legacy.js?v=VERSION_NUMBER","./useController-legacy17.js?v=VERSION_NUMBER","./__commonjsHelpers__-legacy.js?v=VERSION_NUMBER","./site-legacy.js?v=VERSION_NUMBER","./column-legacy.js?v=VERSION_NUMBER","./index-legacy104.js?v=VERSION_NUMBER","./useStore-legacy4.js?v=VERSION_NUMBER"],(function(t,a){"use strict";var u,l,c,f,s,p,h,d,y,m,v,g,b,w,j,O,x,L,E,_,P,S,k,V,U,G,N,F,T;return{setters:[function(t){u=t.G,l=t.bm,c=t.bg,f=t.ag,s=t.bV,p=t.k,h=t.W},function(t){d=t.c,y=t.g,m=t.e,v=t.p,g=t.q,b=t.M,w=t.A,j=t.y,O=t.x,x=t.B,L=t.v,E=t.a_,_=t.F,P=t.D,S=t.aj,k=t.a9,V=t.ai},function(t){U=t.r,G=t.l,N=t.m,F=t.n,T=t.o},null,null,null,null,null],execute:function(){var a={class:"flex items-center"},D={class:"flex items-center justify-center checked-button"};t("default",d({__name:"add-redirect",setup:function(t,d){var R,C,I=d.expose,q=function(t){H.value.redirectdomain=F.value.map((function(t){return t.name}))},A=function(t){H.value.redirectdomain=[]},B=u({data:function(){var t={type:!0,holdpath:!0,domainorpath:"domain",redirecttype:"301",redirectpath:"",tourl:"http://",redirectdomain:[],redirectname:""};if(U.value){var r=U.value,n=r.type,a=r.holdpath,u=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(r,e);Object.assign(t,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({type:1===n,holdpath:1===a},u))}return t},options:function(t){return y((function(){return[{type:"custom",render:function(){return m(c,{label:"开启重定向"},{default:function(){return[m("div",{class:"flex items-center"},[m(l,{modelValue:t.value.type,"onUpdate:modelValue":function(e){return t.value.type=e}},null),m(c,{label:"保留URL参数",style:"margin-left: 4rem;"},{default:function(){return[m(l,{modelValue:t.value.holdpath,"onUpdate:modelValue":function(e){return t.value.holdpath=e}},null)]}})])]}})}},{type:"custom",render:function(){return m(c,{label:"重定向类型"},{default:function(){return[m("div",{class:"flex items-center"},[m(f,{modelValue:t.value.domainorpath,"onUpdate:modelValue":function(e){return t.value.domainorpath=e},options:[{label:"域名",value:"domain"},{label:"路径",value:"path"}],style:"width: 15rem;"},null),m(c,{label:"重定向方式"},{default:function(){return[m(f,{modelValue:t.value.redirecttype,"onUpdate:modelValue":function(e){return t.value.redirecttype=e},options:[{label:"301(永久重定向)",value:"301"},{label:"302(临时重定向)",value:"302"}],style:"width: 15rem;"},null)]}})])]}})}},{type:"slots",key:"domain",rules:{tourl:[s({message:"请输入目标URL",trigger:"blur"}),{validator:function(t,e,r){if("http://"===e||"https://"===e)r(new Error("请输入目标URL"));else try{new URL(e),r()}catch(n){r(new Error("请输入正确的URL"))}},trigger:["change","input"]}],redirectdomain:[{required:!0,message:"请选择重定向域名",trigger:"change"}],redirectpath:[{required:!0,message:"请输入重定向路径",trigger:"blur"}]}}]}))},submit:(R=r().mark((function t(e,n){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n();case 2:return t.next=4,G(e.value);case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})),C=function(){var t=this,e=arguments;return new Promise((function(r,o){var i=R.apply(t,e);function a(t){n(i,r,o,a,u,"next",t)}function u(t){n(i,r,o,a,u,"throw",t)}a(void 0)}))},function(t,e){return C.apply(this,arguments)})}),Y=B.BtForm,H=B.param,M=B.submit;return v(N),I({onConfirm:M}),function(t,e){var r=P,n=V,o=S,i=p,u=k,l=h;return g(),b(O(Y),{class:"p-[2rem]"},{domain:w((function(){return[m(u,{prop:"domain"===O(H).domainorpath?"redirectdomain":"redirectpath",label:"重定向".concat("domain"===O(H).domainorpath?"域名":"路径")},{default:w((function(){return[j("div",a,["domain"===O(H).domainorpath?(g(),b(o,{key:0,"collapse-tags":"",multiple:"",style:{width:"15rem"},modelValue:O(H).redirectdomain,"onUpdate:modelValue":e[0]||(e[0]=function(t){return O(H).redirectdomain=t})},{header:w((function(){return[j("div",D,[m(r,{onClick:q,type:"default"},{default:w((function(){return e[3]||(e[3]=[x("全选")])})),_:1}),m(r,{onClick:A,type:"default"},{default:w((function(){return e[4]||(e[4]=[x("取消全选")])})),_:1})])]})),default:w((function(){return[(g(!0),L(_,null,E(O(F),(function(t,e){return g(),b(n,{key:e,value:t.name,label:t.name},null,8,["value","label"])})),128))]})),_:1},8,["modelValue"])):(g(),b(i,{key:1,width:"15rem",modelValue:O(H).redirectpath,"onUpdate:modelValue":e[1]||(e[1]=function(t){return O(H).redirectpath=t}),placeholder:"如:/b.com"},null,8,["modelValue"])),m(u,{label:"目标url",prop:"tourl"},{default:w((function(){return[m(i,{modelValue:O(H).tourl,"onUpdate:modelValue":e[2]||(e[2]=function(t){return O(H).tourl=t}),width:"24rem"},null,8,["modelValue"])]})),_:1})])]})),_:1},8,["prop","label"]),m(u,null,{default:w((function(){return[m(l,{options:O(T),"list-style":"disc"},null,8,["options"])]})),_:1})]})),_:1})}}}))}}}))}();
Save File
Cancel