1?"loop "+(t.loop-i)+": ":"")+"SHP["+(e?"rp1":"rp2")+"]",o)}t.loop=1}function gn(e,t){const n=t.stack,o=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[o],s=t.fv,a=t.pv,i=n.pop(),l=t.z2[t.contours[i]];let c=l;exports.DEBUG&&console.log(t.step,"SHC["+e+"]",i);const u=a.distance(r,r,!1,!0);do{c!==r&&s.setRelative(c,c,u,a),c=c.nextPointOnContour}while(c!==l)}function mn(e,t){const n=t.stack,o=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[o],s=t.fv,a=t.pv,i=n.pop();let l,c;switch(exports.DEBUG&&console.log(t.step,"SHZ["+e+"]",i),i){case 0:l=t.tZone;break;case 1:l=t.gZone;break;default:throw new Error("Invalid zone")}const u=a.distance(r,r,!1,!0),p=l.length-2;for(let e=0;e",i),t.stack.push(Math.round(64*i))}function Sn(e,t){const n=t.stack,o=n.pop(),r=t.fv,s=t.pv,a=t.ppem,i=t.deltaBase+16*(e-1),l=t.deltaShift,c=t.z0;exports.DEBUG&&console.log(t.step,"DELTAP["+e+"]",o,n);for(let e=0;e>4)!==a)continue;let u=(15&o)-8;u>=0&&u++,exports.DEBUG&&console.log(t.step,"DELTAPFIX",e,"by",u*l);const p=c[e];r.setRelative(p,p,u*l,s)}}function Un(e,t){const n=t.stack,o=n.pop();exports.DEBUG&&console.log(t.step,"ROUND[]"),n.push(64*t.round(o/64))}function Tn(e,t){const n=t.stack,o=n.pop(),r=t.ppem,s=t.deltaBase+16*(e-1),a=t.deltaShift;exports.DEBUG&&console.log(t.step,"DELTAC["+e+"]",o,n);for(let e=0;e>4)!==r)continue;let i=(15&o)-8;i>=0&&i++;const l=i*a;exports.DEBUG&&console.log(t.step,"DELTACFIX",e,"by",l),t.cvt[e]+=l}}function wn(e,t){const n=t.stack,o=n.pop(),r=n.pop(),s=t.z2[o],a=t.z1[r];let i,l;exports.DEBUG&&console.log("SDPVTL["+e+"]",o,r),e?(i=s.y-a.y,l=a.x-s.x):(i=a.x-s.x,l=a.y-s.y),t.dpv=Kt(i,l)}function En(e,t){const n=t.stack,o=t.prog;let r=t.ip;exports.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(let t=0;t=0?1:-1,m=Math.abs(m),e&&(v=s.cvt[i],o&&Math.abs(m-v)":"_")+(o?"R":"_")+(0===r?"Gr":1===r?"Bl":2===r?"Wh":"")+"]",e?i+"("+s.cvt[i]+","+v+")":"",l,"(d =",g,"->",y*m,")"),s.rp1=s.rp0,s.rp2=l,t&&(s.rp0=l)}function kn(e){(e=e||{}).empty||(Gt(e.familyName,"When creating a new Font object, familyName is required."),Gt(e.styleName,"When creating a new Font object, styleName is required."),Gt(e.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),Gt(e.ascender,"When creating a new Font object, ascender is required."),Gt(e.descender,"When creating a new Font object, descender is required."),Gt(e.descender<0,"Descender should be negative (e.g. -512)."),this.names={fontFamily:{en:e.familyName||" "},fontSubfamily:{en:e.styleName||" "},fullName:{en:e.fullName||e.familyName+" "+e.styleName},postScriptName:{en:e.postScriptName||e.familyName+e.styleName},designer:{en:e.designer||" "},designerURL:{en:e.designerURL||" "},manufacturer:{en:e.manufacturer||" "},manufacturerURL:{en:e.manufacturerURL||" "},license:{en:e.license||" "},licenseURL:{en:e.licenseURL||" "},version:{en:e.version||"Version 0.1"},description:{en:e.description||" "},copyright:{en:e.copyright||" "},trademark:{en:e.trademark||" "}},this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.tables={os2:{usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,fsSelection:e.fsSelection||this.fsSelectionValues.REGULAR}}),this.supported=!0,this.glyphs=new Me.GlyphSet(this,e.glyphs||[]),this.encoding=new ve(this),this.substitution=new Mt(this),this.tables=this.tables||{},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:"truetype"===this.outlinesFormat?this._hinting=new zt(this):void 0}})}function Rn(e,t){const n=JSON.stringify(e);let o=256;for(let e in t){let r=parseInt(e);if(r&&!(r<256)){if(JSON.stringify(t[e])===n)return r;o<=r&&(o=r+1)}}return t[o]=e,o}function Dn(e,t,n){const o=Rn(t.name,n);return[{name:"tag_"+e,type:"TAG",value:t.tag},{name:"minValue_"+e,type:"FIXED",value:t.minValue<<16},{name:"defaultValue_"+e,type:"FIXED",value:t.defaultValue<<16},{name:"maxValue_"+e,type:"FIXED",value:t.maxValue<<16},{name:"flags_"+e,type:"USHORT",value:0},{name:"nameID_"+e,type:"USHORT",value:o}]}function Cn(e,t,n){const o={},r=new pe.Parser(e,t);return o.tag=r.parseTag(),o.minValue=r.parseFixed(),o.defaultValue=r.parseFixed(),o.maxValue=r.parseFixed(),r.skip("uShort",1),o.name=n[r.parseUShort()]||{},o}function Mn(e,t,n,o){const r=[{name:"nameID_"+e,type:"USHORT",value:Rn(t.name,o)},{name:"flags_"+e,type:"USHORT",value:0}];for(let o=0;o2)return;const n=this.font;let o=this._prepState;if(!o||o.ppem!==t){let e=this._fpgmState;if(!e){nn.prototype=tn,e=this._fpgmState=new nn("fpgm",n.tables.fpgm),e.funcs=[],e.font=n,exports.DEBUG&&(console.log("---EXEC FPGM---"),e.step=-1);try{At(e)}catch(e){return console.log("Hinting error in FPGM:"+e),void(this._errorState=3)}}nn.prototype=e,o=this._prepState=new nn("prep",n.tables.prep),o.ppem=t;const r=n.tables.cvt;if(r){const e=o.cvt=new Array(r.length),s=t/n.unitsPerEm;for(let t=0;t1))try{return Ft(e,o)}catch(e){return this._errorState<1&&(console.log("Hinting error:"+e),console.log("Note: further hinting errors are silenced")),void(this._errorState=1)}},Ft=function(e,t){const n=t.ppem/t.font.unitsPerEm,o=n;let r,s,a,i=e.components;if(nn.prototype=t,i){const l=t.font;s=[],r=[];for(let e=0;e1?"loop "+(e.loop-n)+": ":"")+"SHPIX[]",a,r),o.setRelative(i,i,r),o.touch(i)}e.loop=1},function(e){const t=e.stack,n=e.rp1,o=e.rp2;let r=e.loop;const s=e.z0[n],a=e.z1[o],i=e.fv,l=e.dpv,c=e.z2;for(;r--;){const u=t.pop(),p=c[u];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-r)+": ":"")+"IP[]",u,n,"<->",o),i.interpolate(p,s,a,l),i.touch(p)}e.loop=1},yn.bind(void 0,0),yn.bind(void 0,1),function(e){const t=e.stack,n=e.rp0,o=e.z0[n];let r=e.loop;const s=e.fv,a=e.pv,i=e.z1;for(;r--;){const n=t.pop(),l=i[n];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-r)+": ":"")+"ALIGNRP[]",n),s.setRelative(l,o,0,a),s.touch(l)}e.loop=1},function(e){exports.DEBUG&&console.log(e.step,"RTDG[]"),e.round=qt},vn.bind(void 0,0),vn.bind(void 0,1),function(e){const t=e.prog;let n=e.ip;const o=e.stack,r=t[++n];exports.DEBUG&&console.log(e.step,"NPUSHB[]",r);for(let e=0;en?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"GTEQ[]",n,o),t.push(o>=n?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"EQ[]",n,o),t.push(n===o?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"NEQ[]",n,o),t.push(n!==o?1:0)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"ODD[]",n),t.push(Math.trunc(n)%2?1:0)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"EVEN[]",n),t.push(Math.trunc(n)%2?0:1)},function(e){let t=e.stack.pop();exports.DEBUG&&console.log(e.step,"IF[]",t),t||(rn(e,!0),exports.DEBUG&&console.log(e.step,"EIF[]"))},function(e){exports.DEBUG&&console.log(e.step,"EIF[]")},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"AND[]",n,o),t.push(n&&o?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"OR[]",n,o),t.push(n||o?1:0)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"NOT[]",n),t.push(n?0:1)},Sn.bind(void 0,1),function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SDB[]",t),e.deltaBase=t},function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SDS[]",t),e.deltaShift=Math.pow(.5,t)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"ADD[]",n,o),t.push(o+n)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"SUB[]",n,o),t.push(o-n)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"DIV[]",n,o),t.push(64*o/n)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"MUL[]",n,o),t.push(o*n/64)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"ABS[]",n),t.push(Math.abs(n))},function(e){const t=e.stack;let n=t.pop();exports.DEBUG&&console.log(e.step,"NEG[]",n),t.push(-n)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"FLOOR[]",n),t.push(64*Math.floor(n/64))},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"CEILING[]",n),t.push(64*Math.ceil(n/64))},Un.bind(void 0,0),Un.bind(void 0,1),Un.bind(void 0,2),Un.bind(void 0,3),void 0,void 0,void 0,void 0,function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"WCVTF[]",n,o),e.cvt[o]=n*e.ppem/e.font.unitsPerEm},Sn.bind(void 0,2),Sn.bind(void 0,3),Tn.bind(void 0,1),Tn.bind(void 0,2),Tn.bind(void 0,3),function(e){let t,n=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SROUND[]",n),e.round=Yt,192&n){case 0:t=.5;break;case 64:t=1;break;case 128:t=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=t,48&n){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*t;break;case 32:e.srPhase=.5*t;break;case 48:e.srPhase=.75*t;break;default:throw new Error("invalid SROUND value")}n&=15,e.srThreshold=0===n?0:(n/8-.5)*t},function(e){let t,n=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"S45ROUND[]",n),e.round=Yt,192&n){case 0:t=Math.sqrt(2)/2;break;case 64:t=Math.sqrt(2);break;case 128:t=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(e.srPeriod=t,48&n){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*t;break;case 32:e.srPhase=.5*t;break;case 48:e.srPhase=.75*t;break;default:throw new Error("invalid S45ROUND value")}n&=15,e.srThreshold=0===n?0:(n/8-.5)*t},void 0,void 0,function(e){exports.DEBUG&&console.log(e.step,"ROFF[]"),e.round=Wt},void 0,function(e){exports.DEBUG&&console.log(e.step,"RUTG[]"),e.round=Vt},function(e){exports.DEBUG&&console.log(e.step,"RDTG[]"),e.round=jt},pn,pn,void 0,void 0,void 0,void 0,void 0,function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCANCTRL[]",t)},wn.bind(void 0,0),wn.bind(void 0,1),function(e){const t=e.stack,n=t.pop();let o=0;exports.DEBUG&&console.log(e.step,"GETINFO[]",n),1&n&&(o=35),32&n&&(o|=4096),t.push(o)},void 0,function(e){const t=e.stack,n=t.pop(),o=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,"ROLL[]"),t.push(o),t.push(n),t.push(r)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"MAX[]",n,o),t.push(Math.max(o,n))},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"MIN[]",n,o),t.push(Math.min(o,n))},function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCANTYPE[]",t)},function(e){const t=e.stack.pop();let n=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"INSTCTRL[]",t,n),t){case 1:return void(e.inhibitGridFit=!!n);case 2:return void(e.ignoreCvt=!!n);default:throw new Error("invalid INSTCTRL[] selector")}},void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,En.bind(void 0,1),En.bind(void 0,2),En.bind(void 0,3),En.bind(void 0,4),En.bind(void 0,5),En.bind(void 0,6),En.bind(void 0,7),En.bind(void 0,8),On.bind(void 0,1),On.bind(void 0,2),On.bind(void 0,3),On.bind(void 0,4),On.bind(void 0,5),On.bind(void 0,6),On.bind(void 0,7),On.bind(void 0,8),Ln.bind(void 0,0,0,0,0,0),Ln.bind(void 0,0,0,0,0,1),Ln.bind(void 0,0,0,0,0,2),Ln.bind(void 0,0,0,0,0,3),Ln.bind(void 0,0,0,0,1,0),Ln.bind(void 0,0,0,0,1,1),Ln.bind(void 0,0,0,0,1,2),Ln.bind(void 0,0,0,0,1,3),Ln.bind(void 0,0,0,1,0,0),Ln.bind(void 0,0,0,1,0,1),Ln.bind(void 0,0,0,1,0,2),Ln.bind(void 0,0,0,1,0,3),Ln.bind(void 0,0,0,1,1,0),Ln.bind(void 0,0,0,1,1,1),Ln.bind(void 0,0,0,1,1,2),Ln.bind(void 0,0,0,1,1,3),Ln.bind(void 0,0,1,0,0,0),Ln.bind(void 0,0,1,0,0,1),Ln.bind(void 0,0,1,0,0,2),Ln.bind(void 0,0,1,0,0,3),Ln.bind(void 0,0,1,0,1,0),Ln.bind(void 0,0,1,0,1,1),Ln.bind(void 0,0,1,0,1,2),Ln.bind(void 0,0,1,0,1,3),Ln.bind(void 0,0,1,1,0,0),Ln.bind(void 0,0,1,1,0,1),Ln.bind(void 0,0,1,1,0,2),Ln.bind(void 0,0,1,1,0,3),Ln.bind(void 0,0,1,1,1,0),Ln.bind(void 0,0,1,1,1,1),Ln.bind(void 0,0,1,1,1,2),Ln.bind(void 0,0,1,1,1,3),Ln.bind(void 0,1,0,0,0,0),Ln.bind(void 0,1,0,0,0,1),Ln.bind(void 0,1,0,0,0,2),Ln.bind(void 0,1,0,0,0,3),Ln.bind(void 0,1,0,0,1,0),Ln.bind(void 0,1,0,0,1,1),Ln.bind(void 0,1,0,0,1,2),Ln.bind(void 0,1,0,0,1,3),Ln.bind(void 0,1,0,1,0,0),Ln.bind(void 0,1,0,1,0,1),Ln.bind(void 0,1,0,1,0,2),Ln.bind(void 0,1,0,1,0,3),Ln.bind(void 0,1,0,1,1,0),Ln.bind(void 0,1,0,1,1,1),Ln.bind(void 0,1,0,1,1,2),Ln.bind(void 0,1,0,1,1,3),Ln.bind(void 0,1,1,0,0,0),Ln.bind(void 0,1,1,0,0,1),Ln.bind(void 0,1,1,0,0,2),Ln.bind(void 0,1,1,0,0,3),Ln.bind(void 0,1,1,0,1,0),Ln.bind(void 0,1,1,0,1,1),Ln.bind(void 0,1,1,0,1,2),Ln.bind(void 0,1,1,0,1,3),Ln.bind(void 0,1,1,1,0,0),Ln.bind(void 0,1,1,1,0,1),Ln.bind(void 0,1,1,1,0,2),Ln.bind(void 0,1,1,1,0,3),Ln.bind(void 0,1,1,1,1,0),Ln.bind(void 0,1,1,1,1,1),Ln.bind(void 0,1,1,1,1,2),Ln.bind(void 0,1,1,1,1,3)],kn.prototype.hasChar=function(e){return null!==this.encoding.charToGlyphIndex(e)},kn.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},kn.prototype.charToGlyph=function(e){const t=this.charToGlyphIndex(e);let n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},kn.prototype.stringToGlyphs=function(e,t){t=t||this.defaultRenderOptions;const n=[];for(let t=0;t>1;e1&&console.warn("Only the first kern subtable is supported."),e.skip("uLong");const n=255&e.parseUShort();if(e.skip("uShort"),0===n){const n=e.parseUShort();e.skip("uShort",3);for(let o=0;o{const t=jn.loadSync(e);$n.font=t,$n.ascender=t.ascender,$n.descender=t.descender}};const Kn=Qn.options,Jn=function(e,t){return Math.round(e+Math.random()*(t-e))};const eo=function(e,t){return{text:(e+t).toString(),equation:e+"+"+t}},to=function(e,t){return{text:(e-t).toString(),equation:e+"-"+t}};function no(e,t,n){return 6*(n=(n+1)%1)<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}var oo={int:Jn,greyColor:function(e,t){const n=Jn(e=e||1,t=t||9).toString(16);return`#${n}${n}${n}`},captchaText:function(e){"number"==typeof e&&(e={size:e});const t=(e=e||{}).size||4,n=e.ignoreChars||"";let o=-1,r="",s=e.charPreset||Kn.charPreset;n&&(s=function(e,t){return e.split("").filter(e=>-1===t.indexOf(e))}(s,n));const a=s.length-1;for(;++o>16,o=t>>8&255,r=255&t,s=Math.max(n,o,r),a=Math.min(n,o,r);return(s+a)/510}(e):1;let r,s;o>=.5?(r=Math.round(100*o)-45,s=Math.round(100*o)-25):(r=Math.round(100*o)+25,s=Math.round(100*o)+45);const a=Jn(r,s)/100,i=a<.5?a*(a+n):a+n-a*n,l=2*a-i,c=Math.floor(255*no(l,i,t+1/3)),u=Math.floor(255*no(l,i,t));return"#"+(Math.floor(255*no(l,i,t-1/3))|u<<8|c<<16|1<<24).toString(16).slice(1)}};const ro=Qn.options,so=function(e,t){e=e||oo.captchaText();const n=(t=Object.assign({},ro,t)).width,o=t.height,r=t.background||t.backgroundColor;r&&(t.color=!0);const s=r?``:"",a=[].concat(function(e,t,n){const o=n.color,r=[],s=n.inverse?7:1,a=n.inverse?15:9;let i=-1;for(;++i`)}return r}(n,o,t)).concat(function(e,t,n,o,r){const s=e.length,a=(t-2)/(s+1),i=o.inverse?10:0,l=o.inverse?14:4;let u=-1;const p=[],h=r||o.color?oo.color(o.background):oo.greyColor(i,l);for(;++u`)}return p}(e,n,o,t)).sort(()=>Math.random()-.5).join("");return`${``};var ao=so,io=oo.captchaText,lo=function(e){const t=e.text||oo.captchaText(e);return{text:t,data:so(t,e)}},co=function(e){const t=oo.mathExpr(e.mathMin,e.mathMax,e.mathOperator);return{text:t.text,data:so(t.equation,e)}},uo=ro,po=Qn.loadFont;ao.randomText=io,ao.create=lo,ao.createMathExpr=co,ao.options=uo,ao.loadFont=po;var ho=ao;var fo=class{constructor(e={}){let{level:t=2,...n}=e;this.width=300,this.height=100;const o=[Math.floor(256*Math.random()),Math.floor(256*Math.random()),Math.floor(256*Math.random())];-1===[1,2,3,4].indexOf(t)&&(t=2);const r={};1===t?Object.assign(r,{lineWidth:5,textColor:o,textLength:4,lineOffset:0,background:[255,250,232],randomLineNum:5},n):2===t?Object.assign(r,{lineWidth:5,textColor:o,textLength:4,lineOffset:0,background:[255,250,232],randomLineNum:10},n):3===t?Object.assign(r,{lineWidth:5,textColor:o,textLength:4,lineOffset:1,background:[255,250,232],randomLineNum:15},n):4===t&&(Object.assign(r,{lineWidth:5,textColor:o,textLength:4,lineOffset:1,background:[255,250,232],randomLineNum:15},n),r.textColor=function(){return[Math.floor(256*Math.random()),Math.floor(256*Math.random()),Math.floor(256*Math.random())]}),this.config=r,this.data=Buffer.alloc(9e4)}setPixel(e,t,n){const o=3*(t*this.width+e);this.data[o]=n.b,this.data[o+1]=n.g,this.data[o+2]=n.r}getFileBuffer(e){const t=54+this.data.length,n=Buffer.alloc(t);return n.write("BM",0),n.writeUInt32LE(t,2),n.writeUInt32LE(0,6),n.writeUInt32LE(54,10),n.writeUInt32LE(40,14),n.writeInt32LE(this.width,18),n.writeInt32LE(-this.height,22),n.writeUInt16LE(1,26),n.writeUInt16LE(24,28),n.writeUInt32LE(0,30),n.writeUInt32LE(this.data.length,34),this.data.copy(n,54),n}setImageBackground(e,t,n){for(let o=0;o=3?Math.floor(11*Math.random())-6:0}getTextOffset(e=0){const t=this.config.textLength,n=Math.round((300-50*t)/2/t);return{x:e*(300/this.config.textLength)+n,y:0}}drawRandomLinesWithVaryingWidth(e){const t=this.width,n=this.height;for(let o=0;o-i&&(u-=i,e+=l),p0){const e=s.data[0];if(e.expired_date{e.scene&&delete e.scene,this.pluginConfig.scene[n]=Object.assign({},t,e[n])})}}}{constructor(){super(),this.DEVICEID2opts={}}mergeConfig(e){const t=yo(this.pluginConfig.scene)?this.pluginConfig.scene[e.scene]:e.scene;return Object.assign({},yo(t)?t:this.pluginConfig,e)}async create(e={}){if(!e.scene)throw new Error("scene验证码场景不可为空");e=this.mergeConfig(e);let{scene:t,expiresDate:n,deviceId:o,clientIP:r,...s}=e;if(o=o||__ctx__.DEVICEID,r=r||__ctx__.CLIENTIP,!o)throw new Error("deviceId不可为空");const a=new To;try{const{text:i,base64:l}=function(e={}){const{uniPlatform:t="",mode:n="svg"}=e;if("svg"===n){let n;n=e.mathExpr?ho.createMathExpr(e):ho.create(e);let o="data:image/svg+xml;utf8,"+n.data.replace(/#/g,"%23");return(!t||["mp-toutiao","h5","web","app","app-plus"].indexOf(t)>-1)&&(o=o.replace(/"/g,"'").replace(//g,"%3E")),{text:n.text,base64:o}}{const t=new fo(JSON.parse(JSON.stringify({...e,textLength:e.size?Number(e.size):void 0,textColor:go(e.color),background:go(e.background)}))),{text:n,base64:o}=t.draw();return{text:n,base64:o}}}(s),c=await a.setVerifyCode({clientIP:r,deviceId:o,code:i,expiresDate:n,scene:t});return c.code>0?{...c,code:10001}:(this.DEVICEID2opts[o]=e,{code:0,msg:"验证码获取成功",captchaBase64:l})}catch(e){return{code:10001,msg:"验证码生成失败:"+e.message}}}async verify({deviceId:e,captcha:t,scene:n}){if(!(e=e||__ctx__.DEVICEID))throw new Error("deviceId不可为空");if(!n)throw new Error("scene验证码场景不可为空");const o=new To;try{const r=await o.verifyCode({deviceId:e,code:t,scene:n});return r.code>0?r:{code:0,msg:"验证码通过"}}catch(e){return{code:10002,msg:"验证码校验失败:"+e.message}}}async refresh(e={}){let{scene:t,expiresDate:n,deviceId:o,...r}=e;if(o=o||__ctx__.DEVICEID,!o)throw new Error("deviceId不可为空");if(!t)throw new Error("scene验证码场景不可为空");const s=await Uo.where(So.command.or([{device_uuid:o,scene:t},{deviceId:o,scene:t}])).orderBy("created_date","desc").limit(1).get();if(s&&s.data&&s.data.length>0){const e=s.data[0];await Uo.doc(e._id).update({state:2}),Object.keys(r).length>0&&(this.DEVICEID2opts[o]=Object.assign({},this.DEVICEID2opts[o],r));let a={};try{a=await this.create(Object.assign({},this.DEVICEID2opts[o],{deviceId:o,scene:t,expiresDate:n}))}catch(e){return{code:50403,msg:e.message}}return a.code>0?{...a,code:50403}:{code:0,msg:"验证码刷新成功",captchaBase64:a.captchaBase64}}return{code:10003,msg:`验证码刷新失败:无此设备在 ${t} 场景信息,请重新获取`}}}const Oo=new To;Object.keys(Oo).forEach(e=>{Eo.prototype[e]=xo(Oo[e])});const Lo=new Eo,ko=new Proxy(Lo,{get(e,t){if(t in e)return"function"==typeof e[t]?xo(e[t]).bind(ko):e[t]}});module.exports=ko;
diff --git a/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/package.json b/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/package.json
deleted file mode 100644
index 6df8de3..0000000
--- a/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/package.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "name": "uni-captcha",
- "version": "0.7.0",
- "description": "uni-captcha",
- "main": "index.js",
- "homepage": "https://ext.dcloud.net.cn/plugin?id=4048",
- "repository": {
- "type": "git",
- "url": "git+https://gitee.com/dcloud/uni-captcha"
- },
- "author": "DCloud",
- "license": "Apache-2.0",
- "dependencies": {
- "uni-config-center": "file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
- }
-}
\ No newline at end of file
diff --git a/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/config.js b/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/config.js
deleted file mode 100644
index c37b38b..0000000
--- a/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/config.js
+++ /dev/null
@@ -1,17 +0,0 @@
-module.exports = {
- "image-captcha":{
- "width": 150, //图片宽度
- "height": 44, //图片高度
- "background": "#FFFAE8", //验证码背景色,设置空字符`''`不使用背景颜色
- // "size": 4, //验证码长度,最多 6 个字符
- // "noise": 4, //验证码干扰线条数
- // "color": false, //字体是否使用随机颜色,当设置`background`后恒为`true`
- // "fontSize": 40, //字体大小
- // "ignoreChars": '', //忽略那些字符
- // "mathExpr": false, //是否使用数学表达式
- // "mathMin": 1, //表达式所使用的最小数字
- // "mathMax": 9, //表达式所使用的最大数字
- // "mathOperator": '' //表达式所使用的运算符,支持 `+`、`-`。不传随机使用
- // "expiresDate":180 //验证码过期时间(s)
- }
-}
\ No newline at end of file
diff --git a/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/index.obj.js b/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/index.obj.js
deleted file mode 100644
index 186e82c..0000000
--- a/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/index.obj.js
+++ /dev/null
@@ -1,35 +0,0 @@
-// 开发文档: https://uniapp.dcloud.net.cn/uniCloud/cloud-obj
-//导入验证码公共模块
-const uniCaptcha = require('uni-captcha')
-//获取数据库对象
-const db = uniCloud.database();
-//获取数据表opendb-verify-codes对象
-const verifyCodes = db.collection('opendb-verify-codes')
-module.exports = {
- async getImageCaptcha({
- scene,isUniAppX
- }) {
- //获取设备id
- let {
- deviceId,
- platform
- } = this.getClientInfo();
- //根据:设备id、场景值、状态,查找记录是否存在
- let res = await verifyCodes.where({
- scene,
- deviceId,
- state: 0
- }).limit(1).get()
- //如果已存在则调用刷新接口,反之调用插件接口
- let action = res.data.length ? 'refresh' : 'create'
- //执行并返回结果
- let option = {
- scene, //来源客户端传递,表示:使用场景值,用于防止不同功能的验证码混用
- uniPlatform: platform
- }
- if(isUniAppX){
- option.mode = "bmp"
- }
- return await uniCaptcha[action](option)
- }
-}
\ No newline at end of file
diff --git a/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/package.json b/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/package.json
deleted file mode 100644
index b5188c3..0000000
--- a/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/package.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "name": "uni-captcha-co",
- "dependencies": {
- "uni-captcha": "file:../common/uni-captcha",
- "uni-config-center": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
- },
- "extensions": {
- "uni-cloud-jql": {}
- }
-}
\ No newline at end of file
diff --git a/uni_modules/uni-captcha/uniCloud/database/opendb-verify-codes.schema.json b/uni_modules/uni-captcha/uniCloud/database/opendb-verify-codes.schema.json
deleted file mode 100644
index 1f3be59..0000000
--- a/uni_modules/uni-captcha/uniCloud/database/opendb-verify-codes.schema.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "bsonType": "object",
- "properties": {
- "_id": {
- "description": "ID,系统自动生成"
- },
- "code": {
- "bsonType": "string",
- "description": "验证码"
- },
- "create_date": {
- "bsonType": "timestamp",
- "description": "创建时间"
- },
- "device_uuid": {
- "bsonType": "string",
- "description": "设备UUID,常用于图片验证码"
- },
- "email": {
- "bsonType": "string",
- "description": "邮箱"
- },
- "expired_date": {
- "bsonType": "timestamp",
- "description": "过期时间"
- },
- "ip": {
- "bsonType": "string",
- "description": "请求时客户端IP地址"
- },
- "mobile": {
- "bsonType": "string",
- "description": "手机号码"
- },
- "scene": {
- "bsonType": "string",
- "description": "使用验证码的场景,如:login, bind, unbind, pay"
- },
- "state": {
- "bsonType": "int",
- "description": "验证状态:0 未验证、1 已验证、2 已作废"
- }
- },
- "required": []
-}
\ No newline at end of file
diff --git a/uni_modules/uni-cloud-s2s/changelog.md b/uni_modules/uni-cloud-s2s/changelog.md
deleted file mode 100644
index 727d5b2..0000000
--- a/uni_modules/uni-cloud-s2s/changelog.md
+++ /dev/null
@@ -1,2 +0,0 @@
-## 1.0.1(2023-03-02)
-- 修复 方法名错误
diff --git a/uni_modules/uni-cloud-s2s/package.json b/uni_modules/uni-cloud-s2s/package.json
deleted file mode 100644
index 339d219..0000000
--- a/uni_modules/uni-cloud-s2s/package.json
+++ /dev/null
@@ -1,83 +0,0 @@
-{
- "id": "uni-cloud-s2s",
- "displayName": "服务空间与服务器安全通讯模块",
- "version": "1.0.1",
- "description": "用于解决服务空间与服务器通讯时互相信任问题",
- "keywords": [
- "安全通讯",
- "服务器请求云函数",
- "云函数请求服务器"
-],
- "repository": "",
- "engines": {
- "HBuilderX": "^3.1.0"
- },
- "dcloudext": {
- "type": "unicloud-template-function",
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": ""
- },
- "uni_modules": {
- "dependencies": [],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "Vue": {
- "vue2": "u",
- "vue3": "u"
- },
- "App": {
- "app-vue": "u",
- "app-nvue": "u"
- },
- "H5-mobile": {
- "Safari": "u",
- "Android Browser": "u",
- "微信浏览器(Android)": "u",
- "QQ浏览器(Android)": "u"
- },
- "H5-pc": {
- "Chrome": "u",
- "IE": "u",
- "Edge": "u",
- "Firefox": "u",
- "Safari": "u"
- },
- "小程序": {
- "微信": "u",
- "阿里": "u",
- "百度": "u",
- "字节跳动": "u",
- "QQ": "u",
- "钉钉": "u",
- "快手": "u",
- "飞书": "u",
- "京东": "u"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/uni_modules/uni-cloud-s2s/readme.md b/uni_modules/uni-cloud-s2s/readme.md
deleted file mode 100644
index 3c8ed0c..0000000
--- a/uni_modules/uni-cloud-s2s/readme.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# uni-cloud-s2s
-
-文档见:[外部服务器如何与uniCloud安全通讯](https://uniapp.dcloud.net.cn/uniCloud/uni-cloud-s2s.html)
\ No newline at end of file
diff --git a/uni_modules/uni-cloud-s2s/uniCloud/cloudfunctions/common/uni-cloud-s2s/index.js b/uni_modules/uni-cloud-s2s/uniCloud/cloudfunctions/common/uni-cloud-s2s/index.js
deleted file mode 100644
index da9a36c..0000000
--- a/uni_modules/uni-cloud-s2s/uniCloud/cloudfunctions/common/uni-cloud-s2s/index.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("crypto"),t=require("path");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("fs");var o=s(e),n=s(t);const i="uni-cloud-s2s",r={code:5e4,message:"Config error"},c={code:51e3,message:"Access denied"};class a extends Error{constructor(e){super(e.message),this.errMsg=e.message||"",this.code=this.errCode=e.code,this.errSubject=e.subject,this.forceReturn=e.forceReturn||!1,this.cause=e.cause,Object.defineProperties(this,{message:{get(){return this.errMsg},set(e){this.errMsg=e}}})}toJSON(e=0){if(!(e>=10))return e++,{errCode:this.errCode,errMsg:this.errMsg,errSubject:this.errSubject,cause:this.cause&&this.cause.toJSON?this.cause.toJSON(e):this.cause}}}const d=Object.prototype.toString;const h=50002,u=Object.create(null);["string","boolean","number","null"].forEach((e=>{u[e]=function(t,s){if(function(e){return d.call(e).slice(8,-1).toLowerCase()}(t)!==e)return{code:h,message:`${s} is invalid`}}}));const f="Unicloud-S2s-Authorization";class g{constructor(e){const{config:t}=e||{};this.config=t;const{connectCode:s}=t||{};if(this.connectCode=s,!s||"string"!=typeof s)throw new a({subject:i,code:r.code,message:"Invalid connectCode in config"})}getHeadersValue(e={},t,s){const o=Object.keys(e||{}).find((e=>e.toLowerCase()===t.toLowerCase()));return o?e[o]:s}verifyHttpInfo(e){const t=this.getHeadersValue(e.headers,f,""),[s="",o=""]=t.split(" ");if(s.toLowerCase()==="CONNECTCODE".toLowerCase()&&o===this.config.connectCode)return!0;throw new a({subject:i,code:c.code,message:`Invalid CONNECTCODE in headers['${f}']`})}getSecureHeaders(e){return{[f]:`CONNECTCODE ${this.config.connectCode}`}}}function l(e){return function(t){const{content:s,signKey:n}=t||{};return o.default.createHash(e).update(s+"\n"+n).digest("hex")}}const p={md5:l("md5"),sha1:l("sha1"),sha256:l("md5"),"hmac-sha256":function(e){const{content:t,signKey:s}=e||{};return o.default.createHmac("sha256",s).update(t).digest("hex")}};function m(e){const{timestamp:t,data:s={},signKey:o,hashMethod:n="hmac-sha256"}=e||{},i=p[n],r=["number","string","boolean"],c=Object.keys(s).sort(),a=[];for(let e=0;ee.toLowerCase()===t.toLowerCase()));return o?e[o]:s}getHttpData(e){const t=e.httpMethod.toLowerCase(),s=this.getHttpHeaders(e),o=this.getHeadersValue(s,"Content-Type","");if("get"===t)return e.queryStringParameters;if("post"!==t)throw new a({subject:i,code:c.code,message:`Invalid http method, expected "POST" or "get", got "${t}"`});if(0===o.indexOf("application/json"))return JSON.parse(e.body);if(0===o.indexOf("application/x-www-form-urlencoded"))return require("querystring").parse(e.body);throw new a({subject:i,code:c.code,message:`Invalid content type of POST method, expected "application/json" or "application/x-www-form-urlencoded", got "${o}"`})}verifyHttpInfo(e){const t=e.headers||{},s=this.getHeadersValue(t,"Unicloud-S2s-Timestamp","0");let[o,n]=this.getHeadersValue(t,"Unicloud-S2s-Signature","").split(" ");if(o=o.toLowerCase(),o!==this.hashMethod)throw new a({subject:i,code:c.code,message:`Invalid hash method, expected "${this.hashMethod}", got "${o}"`});const r=parseInt(s),d=Date.now();if(Math.abs(d-r)>1e3*this.timeDiffTolerance)throw new a({subject:i,code:c.code,message:`Invalid timestamp, server timestamp is ${d}, ${r} exceed max timeDiffTolerance(${this.timeDiffTolerance} seconds)`});return m({timestamp:r,data:this.getHttpData(e),signKey:this.signKey,hashMethod:this.hashMethod})===n}getSecureHeaders(e){const{data:t}=e||{},s=Date.now(),o=m({timestamp:s,data:t,signKey:this.signKey,hashMethod:this.hashMethod});return{"Unicloud-S2s-Timestamp":s+"","Unicloud-S2s-Signature":this.hashMethod+" "+o}}}const y=require("uni-config-center")({pluginId:i});class b{constructor(){this.config=y.config();const e=n.default.resolve(require.resolve("uni-config-center"),i,"config.json");if(!this.config)throw new a({subject:i,code:r.code,message:`${i} config required, please check your config file: ${e}`});if("connectCode"===this.config.type)this.verifier=new g({config:this.config});else{if(!function(e){return"sign"===e.type}(this.config))throw new a({subject:i,code:r.code,message:`Invalid ${i} config, expected policy is "code" or "sign", got ${this.config.policy}`});this.verifier=new w({config:this.config})}}verifyHttpInfo(e){if(!e)throw new a({subject:i,code:c.code,message:"Access denied, httpInfo required"});return this.verifier.verifyHttpInfo(e)}getSecureHeaders(e){return this.verifier.getSecureHeaders(e)}}exports.getSecureHeaders=function(e){return(new b).getSecureHeaders(e)},exports.verifyHttpInfo=function(e){const t=(new b).verifyHttpInfo(e);if(!t)throw new a({subject:i,code:c.code,message:c.message});return t};
diff --git a/uni_modules/uni-cloud-s2s/uniCloud/cloudfunctions/common/uni-cloud-s2s/package.json b/uni_modules/uni-cloud-s2s/uniCloud/cloudfunctions/common/uni-cloud-s2s/package.json
deleted file mode 100644
index e99f52c..0000000
--- a/uni_modules/uni-cloud-s2s/uniCloud/cloudfunctions/common/uni-cloud-s2s/package.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "uni-cloud-s2s",
- "version": "1.0.1",
- "description": "",
- "keywords": [],
- "author": "DCloud",
- "main": "index.js",
- "dependencies": {
- "uni-config-center": "file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
- }
-}
\ No newline at end of file
diff --git a/uni_modules/uni-cms-article/changelog.md b/uni_modules/uni-cms-article/changelog.md
deleted file mode 100644
index f350e47..0000000
--- a/uni_modules/uni-cms-article/changelog.md
+++ /dev/null
@@ -1,41 +0,0 @@
-## 1.0.16(2024-06-21)
-- 修复 小程序发布时无法上传的Bug
-## 1.0.15(2024-06-20)
-- 修复 小程序访问文章列表报错的Bug
-## 1.0.14(2024-06-12)
-- 修复 客户端无法显示文章详情问题的Bug
-## 1.0.13(2023-12-09)
-- 新增 支持uni-app-x,需要[uni-cms](https://ext.dcloud.net.cn/plugin?id=11700)插件版本>=1.0.17
-## 1.0.12(2023-10-17)
-- 修复 使用腾讯云服务空间时无法加载封面图及正文图片的问题
-## 1.0.11(2023-08-07)
-- 修复 Vue3下因`parse-scen-result.js`文件导出问题导致无法打包编译的bug
-## 1.0.10(2023-07-14)
-- 新增 文章预览功能,详见[文档](https://uniapp.dcloud.net.cn/uniCloud/uni-cms.html#article-preview)(需要uni-cms版本>=1.0.14)
-- 修复 文章详情页换行重复问题
-- 修复 文章列表在数据量小时下拉刷新数据会重复的问题
-## 1.0.9(2023-07-10)
-- 优化 文章详情页正文可以渲染多个换行
-## 1.0.8(2023-06-21)
-- 增加 文章列表无图、三图封面样式(需要uni-cms版本>=1.0.12)
-- 优化 文章详情页样式
-- 修复 在Vue3下出现 require is not defined 问题
-## 1.0.7(2023-06-07)
-- 新增 文章详情页面支持播放视频(发布视频需要uni-cms版本>=1.0.11)
-- 优化 文章正文渲染逻辑
-- 优化 文章详情页面样式
-- 修复 在文章详情页下点击返回按钮无响应问题
-## 1.0.6(2023-04-28)
-- 修复 文章详情只存在列表时无法渲染的问题
-## 1.0.5(2023-04-24)
-- 增加 license 文件
-## 1.0.4(2023-04-21)
-- 优化代码结构,增加代码注释,提高可读性
-## 1.0.3(2023-04-17)
-- 移除无用schema文件
-## 1.0.2(2023-04-12)
-- 优化看广告解锁文章交互
-## 1.0.1(2023-04-12)
-- 优化页面逻辑
-## 1.0.0(2023-04-11)
-- 插件发布,支持图文内容展示、广告解锁全文功能 [详见文档](https://uniapp.dcloud.net.cn/uniCloud/uni-cms.html)
diff --git a/uni_modules/uni-cms-article/common/parse-image-url.js b/uni_modules/uni-cms-article/common/parse-image-url.js
deleted file mode 100644
index 8180074..0000000
--- a/uni_modules/uni-cms-article/common/parse-image-url.js
+++ /dev/null
@@ -1,68 +0,0 @@
-function parseEditorImage (blocks = []) {
- const images = []
-
- if (!Array.isArray(blocks)) {
- blocks = [blocks]
- }
-
- for (const block of blocks) {
- const {insert = {}, attributes = {}} = block
- const {'data-custom': custom = ""} = attributes
-
- let parseCustom = custom.split('&').reduce((obj, item) => {
- const [key, value] = item.split('=')
-
- if (key && value) {
- obj[key] = value
- }
- return obj
- }, {})
-
- images.push({
- src: insert.image,
- source: parseCustom.source ? parseCustom.source: insert.image
- })
- }
-
- return images
-}
-
-/**
- * 解析媒体库/编辑器中的图片
- * @param images 图片地址
- * @param type {string} 解析类型 media: 媒体库, editor: 编辑器
- * @returns {Promise<{src: *, source: *}[]|{src, source: *}[]>}
- */
-export async function parseImageUrl (images = [], type = "media") {
- if (type === "editor") {
- images = parseEditorImage(images).map(item => item.source)
- } else {
- if (!Array.isArray(images)) {
- images = [images]
- }
- }
-
- if (!images) return null
-
- const tcbFiles = images.filter(item => item.startsWith("cloud://"))
-
- if (tcbFiles.length) {
- const res = await uniCloud.getTempFileURL({
- fileList: tcbFiles
- })
-
- return images.map(image => {
- const file = res.fileList.find(item => item.fileID === image)
-
- return {
- src: file ? file.tempFileURL : image,
- source: image
- }
- })
- } else {
- return images.map(image => ({
- src: image,
- source: image
- }))
- }
-}
diff --git a/uni_modules/uni-cms-article/common/parse-image-url.uts b/uni_modules/uni-cms-article/common/parse-image-url.uts
deleted file mode 100644
index 1f8e31e..0000000
--- a/uni_modules/uni-cms-article/common/parse-image-url.uts
+++ /dev/null
@@ -1,80 +0,0 @@
-export type ParseImageUrlResult = {
- src: string
- source: string
-}
-function parseEditorImage (_blocks: any): UTSJSONObject[] {
- const images: UTSJSONObject[] = []
- let blocks: UTSJSONObject[]
-
- if (!Array.isArray(_blocks)) {
- blocks = [_blocks as UTSJSONObject] as UTSJSONObject[]
- } else {
- blocks = _blocks as UTSJSONObject[]
- }
-
- blocks.forEach((block: UTSJSONObject) => {
- const insert = block.getJSON('insert')
- const attributes = block.getJSON('attributes')
- const custom = attributes!.getString('data-custom')
-
- let parseCustom = custom && custom.split('&') ? custom.split('&').reduce((obj: UTSJSONObject, item: string): UTSJSONObject => {
- const kv = item.split('=')
-
- if (kv.length > 1) {
- obj[kv[0]] = kv[1]
- }
-
- return obj
- }, {} as UTSJSONObject) : {}
-
- images.push({
- src: insert!.getString('image'),
- source: parseCustom.getString('source') != null ? parseCustom.getString('source') : insert!.getString('image')
- })
- })
-
- return images
-}
-
-/**
- * 解析媒体库/编辑器中的图片
- * @param images 图片地址
- * @param type {string} 解析类型 media: 媒体库, editor: 编辑器
- * @returns {Promise<{src: *, source: *}[]|{src, source: *}[]>}
- */
-export async function parseImageUrl (images: any, type: string = "media"): Promise {
- let imagePaths: string[] = []
- if (type === "editor") {
- imagePaths = parseEditorImage(images).map((item: UTSJSONObject): string => item.getString('source')!)
- } else {
- if (!Array.isArray(images)) {
- imagePaths = [images as string] as string[]
- } else {
- imagePaths = images
- }
- }
-
- if (imagePaths.length <= 0) return null
-
- const tcbFiles = imagePaths.filter((item: string): boolean => item.startsWith("cloud://"))
-
- if (tcbFiles.length > 0) {
- const res: UniCloudGetTempFileURLResult = await uniCloud.getTempFileURL({
- fileList: tcbFiles
- })
-
- return imagePaths.map((image: string): ParseImageUrlResult => {
- const file = res.fileList.find((item: UniCloudGetTempFileURLResultItem): boolean => item.fileID === image)
-
- return {
- src: file ? file.tempFileURL : image,
- source: image
- } as ParseImageUrlResult
- })
- } else {
- return imagePaths.map((image: string): ParseImageUrlResult => ({
- src: image,
- source: image
- } as ParseImageUrlResult))
- }
-}
diff --git a/uni_modules/uni-cms-article/common/parse-scan-result.js b/uni_modules/uni-cms-article/common/parse-scan-result.js
deleted file mode 100644
index 3436849..0000000
--- a/uni_modules/uni-cms-article/common/parse-scan-result.js
+++ /dev/null
@@ -1,28 +0,0 @@
-function parseScanResult (scanText) {
- const match = scanText.match(/^(.*?):\/\/(.*)/)
-
- if (!match || match.length < 1) {
- uni.showToast({
- icon: 'none',
- title: '未能识别到有效信息'
- })
- }
-
- const [, protocol, path] = match
-
- switch (protocol) {
- case "internallink":
- uni.navigateTo({
- url: `/${path.replace(/^\//, '')}`,
- fail: () => {
- uni.showToast({
- icon: "none",
- title: "访问的路径不存在"
- })
- }
- })
- break
- }
-}
-
-export default parseScanResult
diff --git a/uni_modules/uni-cms-article/common/parse-scan-result.uts b/uni_modules/uni-cms-article/common/parse-scan-result.uts
deleted file mode 100644
index 78744af..0000000
--- a/uni_modules/uni-cms-article/common/parse-scan-result.uts
+++ /dev/null
@@ -1,28 +0,0 @@
-function parseScanResult (scanText: string): void {
- const match = scanText.match(/^(.*?):\/\/(.*)/)
-
- if (!match || match.length < 1) {
- uni.showToast({
- icon: 'none',
- title: '未能识别到有效信息'
- })
- }
-
- const [, protocol, path] = match
-
- switch (protocol) {
- case "internallink":
- uni.navigateTo({
- url: `/${path.replace(/^\//, '')}`,
- fail: () => {
- uni.showToast({
- icon: "none",
- title: "访问的路径不存在"
- })
- }
- })
- break
- }
-}
-
-export default parseScanResult
diff --git a/uni_modules/uni-cms-article/common/publish-time.js b/uni_modules/uni-cms-article/common/publish-time.js
deleted file mode 100644
index 7163e4b..0000000
--- a/uni_modules/uni-cms-article/common/publish-time.js
+++ /dev/null
@@ -1,93 +0,0 @@
-export default function translatePublishTime(timestamp) {
- let result = ''
- // 获取当前时间
- const currentData = new Date()
- // 获取发布时间
- const date = new Date(timestamp)
- // 获取发布年份
- const year = date.getFullYear()
- // 获取发布月份
- const mouth = date.getMonth() + 1
- // 获取发布日期
- const day = date.getDate()
- // 获取发布小时
- const hours = date.getHours()
- // 获取发布分钟
- const minute = date.getMinutes()
- // 获取发布秒数
- const second = date.getSeconds()
- // 获取发布时间戳
- const timer = date.getTime()
- // 获取当前年份
- const currentYear = currentData.getFullYear()
- // 获取当前月份
- const currentMonth = currentData.getMonth() + 1
- // 获取当前日期
- const currentDay = currentData.getDate()
- // 获取当前小时
- const currentHours = currentData.getHours()
- // 获取当前分钟
- let currentMinute = currentData.getMinutes()
- // 获取当前秒数
- const currentSecond = currentData.getSeconds()
- // 获取当前时间戳
- const currentTimer = currentData.getTime()
-
- // 如果时间差小于10秒
- if ((currentTimer - timer) < 1000 * 10) {
- // 显示刚刚
- result = `刚刚`;
- // 如果时间差小于60秒
- } else if ((currentTimer - timer) < 1000 * 60) {
- // 如果当前分钟大于发布分钟
- if (currentMinute > minute) {
- // 显示秒数差
- result = `${(((currentMinute - minute) * 60) + currentSecond - second)}秒前`;
- } else {
- // 显示秒数差
- result = `${(currentSecond - second)}秒前`;
- }
- // 如果时间差小于1小时
- } else if ((currentTimer - timer) < 1000 * (60 * 60)) {
- // 如果当前小时大于发布小时
- if (currentHours > hours) {
- // 显示分钟差
- result = `${(((currentHours - hours) * 60) + currentMinute - minute)}分钟前`;
- } else {
- // 修改 昨天发布的文章时间会出现负数
- // 如果当前分钟小于发布分钟
- if (currentMinute < minute) {
- // 当前分钟加60
- currentMinute += 60
- }
- // 显示分钟差
- result = `${(currentMinute - minute)}分钟前`;
- }
- // 如果时间差小于1天
- } else if ((currentTimer - timer) < 1000 * (24 * 60 * 60)) {
- // 如果当前日期大于发布日期
- if (currentDay > day) {
- // 显示小时差
- result = `${((currentDay - day) * 24 + currentHours - hours)}小时前`;
- } else {
- // 修改 跨月-昨天发布的文章时间会出现负数
- // 如果当前月份不等于发布月份
- if (currentMonth !== mouth) {
- // 显示小时差
- result = `${(24 + currentHours - hours)}小时前`;
- } else {
- // 显示小时差
- result = `${(currentHours - hours)}小时前`;
- }
- }
- // 如果发布年份等于当前年份
- } else if (currentYear === year) {
- // 显示月份和日期
- result = `${mouth}月${day}日`;
- } else {
- // 显示年份、月份和日期
- result = `${year}年${mouth}月${day}日`;
- }
- return result // 返回结果
-}
-
diff --git a/uni_modules/uni-cms-article/common/publish-time.uts b/uni_modules/uni-cms-article/common/publish-time.uts
deleted file mode 100644
index 23b7761..0000000
--- a/uni_modules/uni-cms-article/common/publish-time.uts
+++ /dev/null
@@ -1,93 +0,0 @@
-export default function translatePublishTime(timestamp: number): string {
- let result: string
- // 获取当前时间
- const currentData = new Date()
- // 获取发布时间
- const date = new Date(timestamp)
- // 获取发布年份
- const year = date.getFullYear()
- // 获取发布月份
- const mouth = date.getMonth() + 1
- // 获取发布日期
- const day = date.getDate()
- // 获取发布小时
- const hours = date.getHours()
- // 获取发布分钟
- const minute = date.getMinutes()
- // 获取发布秒数
- const second = date.getSeconds()
- // 获取发布时间戳
- const timer = date.getTime()
- // 获取当前年份
- const currentYear = currentData.getFullYear()
- // 获取当前月份
- const currentMonth = currentData.getMonth() + 1
- // 获取当前日期
- const currentDay = currentData.getDate()
- // 获取当前小时
- const currentHours = currentData.getHours()
- // 获取当前分钟
- let currentMinute = currentData.getMinutes()
- // 获取当前秒数
- const currentSecond = currentData.getSeconds()
- // 获取当前时间戳
- const currentTimer = currentData.getTime()
-
- // 如果时间差小于10秒
- if ((currentTimer - timer) < 1000 * 10) {
- // 显示刚刚
- result = `刚刚`;
- // 如果时间差小于60秒
- } else if ((currentTimer - timer) < 1000 * 60) {
- // 如果当前分钟大于发布分钟
- if (currentMinute > minute) {
- // 显示秒数差
- result = `${(((currentMinute - minute) * 60) + currentSecond - second)}秒前`;
- } else {
- // 显示秒数差
- result = `${(currentSecond - second)}秒前`;
- }
- // 如果时间差小于1小时
- } else if ((currentTimer - timer) < 1000 * (60 * 60)) {
- // 如果当前小时大于发布小时
- if (currentHours > hours) {
- // 显示分钟差
- result = `${(((currentHours - hours) * 60) + currentMinute - minute)}分钟前`;
- } else {
- // 修改 昨天发布的文章时间会出现负数
- // 如果当前分钟小于发布分钟
- if (currentMinute < minute) {
- // 当前分钟加60
- currentMinute += 60
- }
- // 显示分钟差
- result = `${(currentMinute - minute)}分钟前`;
- }
- // 如果时间差小于1天
- } else if ((currentTimer - timer) < 1000 * (24 * 60 * 60)) {
- // 如果当前日期大于发布日期
- if (currentDay > day) {
- // 显示小时差
- result = `${((currentDay - day) * 24 + currentHours - hours)}小时前`;
- } else {
- // 修改 跨月-昨天发布的文章时间会出现负数
- // 如果当前月份不等于发布月份
- if (currentMonth !== mouth) {
- // 显示小时差
- result = `${(24 + currentHours - hours)}小时前`;
- } else {
- // 显示小时差
- result = `${(currentHours - hours)}小时前`;
- }
- }
- // 如果发布年份等于当前年份
- } else if (currentYear === year) {
- // 显示月份和日期
- result = `${mouth}月${day}日`;
- } else {
- // 显示年份、月份和日期
- result = `${year}年${mouth}月${day}日`;
- }
- return result // 返回结果
-}
-
diff --git a/uni_modules/uni-cms-article/components/list-template/not-cover.uvue b/uni_modules/uni-cms-article/components/list-template/not-cover.uvue
deleted file mode 100644
index be45230..0000000
--- a/uni_modules/uni-cms-article/components/list-template/not-cover.uvue
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
- {{ data?.title }}
-
-
- {{ data!.user_id!.length > 0 ? data!.user_id[0]!.nickname : '' }}
- {{ publishTime(data?.publish_date ?? 0) }}
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/components/list-template/not-cover.vue b/uni_modules/uni-cms-article/components/list-template/not-cover.vue
deleted file mode 100644
index 966826e..0000000
--- a/uni_modules/uni-cms-article/components/list-template/not-cover.vue
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
- {{ data.title }}
-
-
- {{ data.user_id[0] ? data.user_id[0].nickname : '' }}
- {{ publishTime(data.publish_date) }}
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/components/list-template/right-small-cover.uvue b/uni_modules/uni-cms-article/components/list-template/right-small-cover.uvue
deleted file mode 100644
index ffa620c..0000000
--- a/uni_modules/uni-cms-article/components/list-template/right-small-cover.uvue
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
- {{ data?.title }}
-
- {{ data!.user_id!.length > 0 ? data!.user_id[0]!.nickname : '' }}
- {{ publishTime(data?.publish_date ?? 0) }}
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/components/list-template/right-small-cover.vue b/uni_modules/uni-cms-article/components/list-template/right-small-cover.vue
deleted file mode 100644
index 4bf2acd..0000000
--- a/uni_modules/uni-cms-article/components/list-template/right-small-cover.vue
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
- {{ data.title }}
-
- {{ data.user_id[0] ? data.user_id[0].nickname : '' }}
- {{ publishTime(data.publish_date) }}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/components/list-template/style.scss b/uni_modules/uni-cms-article/components/list-template/style.scss
deleted file mode 100644
index 9b70a1b..0000000
--- a/uni_modules/uni-cms-article/components/list-template/style.scss
+++ /dev/null
@@ -1,63 +0,0 @@
-.list-item {
- &.not-cover {
- .main {
- .info {
- margin-top: 20rpx;
- }
- }
- }
- .main {
- display: flex;
- justify-content: space-between;
- flex-direction: column;
- flex: 1;
- .title {
- font-size: 30rpx;
- color: #333333;
- }
-
- .thumbnails {
- margin: 20rpx 0;
- display: flex;
- align-items: center;
- flex-direction: row;
- .img {
- flex: 1;
- /* #ifndef APP-NVUE */
- width: auto;
- /* #endif */
- height: 200rpx;
- border-radius: 8rpx;
- margin: 0 10rpx;
- &:first-child {
- margin-left: 0;
- }
- &:last-child {
- margin-right: 0;
- }
- }
- }
-
- .info {
- display: flex;
- flex-direction: row;
- }
-
- .author,
- .publish_date {
- font-size: 24rpx;
- color: #bbbbbb;
- }
-
- .publish_date {
- margin-left: 14rpx;
- }
- }
-
- .thumbnail {
- width: 240rpx;
- height: 160rpx;
- margin-left: 20rpx;
- border-radius: 8rpx;
- }
-}
diff --git a/uni_modules/uni-cms-article/components/list-template/three-cover.uvue b/uni_modules/uni-cms-article/components/list-template/three-cover.uvue
deleted file mode 100644
index 6f1f123..0000000
--- a/uni_modules/uni-cms-article/components/list-template/three-cover.uvue
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
- {{ data?.title }}
-
-
-
-
- {{ data!.user_id!.length > 0 ? data!.user_id[0]!.nickname : '' }}
- {{ publishTime(data?.publish_date ?? 0) }}
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/components/list-template/three-cover.vue b/uni_modules/uni-cms-article/components/list-template/three-cover.vue
deleted file mode 100644
index 81b98b7..0000000
--- a/uni_modules/uni-cms-article/components/list-template/three-cover.vue
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
- {{ data.title }}
-
-
-
-
- {{ data.user_id[0] ? data.user_id[0].nickname : '' }}
- {{ publishTime(data.publish_date) }}
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/components/refresh-box/refreshBox.nvue b/uni_modules/uni-cms-article/components/refresh-box/refreshBox.nvue
deleted file mode 100644
index 1ae0b03..0000000
--- a/uni_modules/uni-cms-article/components/refresh-box/refreshBox.nvue
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
- {{config[state].text}}
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/components/refresh-box/refreshBox.uvue b/uni_modules/uni-cms-article/components/refresh-box/refreshBox.uvue
deleted file mode 100644
index 1ae0b03..0000000
--- a/uni_modules/uni-cms-article/components/refresh-box/refreshBox.uvue
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
- {{config[state].text}}
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/components/render-article-detail/image.uvue b/uni_modules/uni-cms-article/components/render-article-detail/image.uvue
deleted file mode 100644
index 1269161..0000000
--- a/uni_modules/uni-cms-article/components/render-article-detail/image.uvue
+++ /dev/null
@@ -1,167 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/components/render-article-detail/image.vue b/uni_modules/uni-cms-article/components/render-article-detail/image.vue
deleted file mode 100644
index c516de6..0000000
--- a/uni_modules/uni-cms-article/components/render-article-detail/image.vue
+++ /dev/null
@@ -1,131 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/components/render-article-detail/index.vue b/uni_modules/uni-cms-article/components/render-article-detail/index.vue
deleted file mode 100644
index f2b29e8..0000000
--- a/uni_modules/uni-cms-article/components/render-article-detail/index.vue
+++ /dev/null
@@ -1,129 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/components/render-article-detail/list.vue b/uni_modules/uni-cms-article/components/render-article-detail/list.vue
deleted file mode 100644
index e960a7b..0000000
--- a/uni_modules/uni-cms-article/components/render-article-detail/list.vue
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
- {{data.type === 'ordered' ? `${index + 1}.` : '•'}}
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/components/render-article-detail/text.vue b/uni_modules/uni-cms-article/components/render-article-detail/text.vue
deleted file mode 100644
index 9a4c9a8..0000000
--- a/uni_modules/uni-cms-article/components/render-article-detail/text.vue
+++ /dev/null
@@ -1,160 +0,0 @@
-
-
-
-
- {{item.data.value}}
-
-
- {{item.data.value}}
-
-
-
-
-
-
- \n
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/components/render-article-detail/unlock-content.vue b/uni_modules/uni-cms-article/components/render-article-detail/unlock-content.vue
deleted file mode 100644
index b416698..0000000
--- a/uni_modules/uni-cms-article/components/render-article-detail/unlock-content.vue
+++ /dev/null
@@ -1,216 +0,0 @@
-
-
-
-
-
-
-
-
-
- 广告加载失败
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/components/render-article-detail/video.vue b/uni_modules/uni-cms-article/components/render-article-detail/video.vue
deleted file mode 100644
index 472f0bc..0000000
--- a/uni_modules/uni-cms-article/components/render-article-detail/video.vue
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/components/uni-cms-article-icons/uni-cms-article-icons.uvue b/uni_modules/uni-cms-article/components/uni-cms-article-icons/uni-cms-article-icons.uvue
deleted file mode 100644
index 4b2fefd..0000000
--- a/uni_modules/uni-cms-article/components/uni-cms-article-icons/uni-cms-article-icons.uvue
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
- {{iconCode}}
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/components/uni-cms-article-list/uni-cms-article-list.vue b/uni_modules/uni-cms-article/components/uni-cms-article-list/uni-cms-article-list.vue
deleted file mode 100644
index 22840ba..0000000
--- a/uni_modules/uni-cms-article/components/uni-cms-article-list/uni-cms-article-list.vue
+++ /dev/null
@@ -1,371 +0,0 @@
-
-
-
-
- 当前网络不可用,请点击重试
-
-
-
- {{ refreshText[refreshState] }}
-
-
-
-
-
-
-
- {{ item.title }}
-
-
-
- {{ item!.user_id!.length > 0 ? item.user_id[0].nickname : '' }}
-
-
- {{ publishTime(item.publish_date) }}
-
-
-
-
-
-
-
- {{ item.title }}
-
-
-
- {{ item!.user_id!.length > 0 ? item.user_id[0].nickname : '' }}
-
-
- {{ publishTime(item.publish_date) }}
-
-
-
-
-
-
-
-
-
-
- {{ item.title }}
-
-
-
-
-
-
- {{ item!.user_id!.length > 0 ? item.user_id[0].nickname : '' }}
-
-
- {{ publishTime(item.publish_date) }}
-
-
-
-
-
-
- {{ loading ? '加载中...' : (hasMore ? '上拉加载更多' : '没有更多数据了') }}
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/components/uni-cms-article-search-bar/uni-cms-article-search-bar.uvue b/uni_modules/uni-cms-article/components/uni-cms-article-search-bar/uni-cms-article-search-bar.uvue
deleted file mode 100644
index 54a65ce..0000000
--- a/uni_modules/uni-cms-article/components/uni-cms-article-search-bar/uni-cms-article-search-bar.uvue
+++ /dev/null
@@ -1,195 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- 请输入搜索内容
-
-
-
-
-
-
-
- 搜索
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/components/uni-load-state/i18n/en.json b/uni_modules/uni-cms-article/components/uni-load-state/i18n/en.json
deleted file mode 100644
index b600ad4..0000000
--- a/uni_modules/uni-cms-article/components/uni-load-state/i18n/en.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "noData": "No Data",
- "noNetwork": "Network error",
- "toSet": "Go to settings",
- "error": "error"
-}
diff --git a/uni_modules/uni-cms-article/components/uni-load-state/i18n/index.js b/uni_modules/uni-cms-article/components/uni-load-state/i18n/index.js
deleted file mode 100644
index c70a386..0000000
--- a/uni_modules/uni-cms-article/components/uni-load-state/i18n/index.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import en from './en.json'
-import zhHans from './zh-Hans.json'
-export default {
- en,
- 'zh-Hans': zhHans
-}
diff --git a/uni_modules/uni-cms-article/components/uni-load-state/i18n/zh-Hans.json b/uni_modules/uni-cms-article/components/uni-load-state/i18n/zh-Hans.json
deleted file mode 100644
index 4fa8e1a..0000000
--- a/uni_modules/uni-cms-article/components/uni-load-state/i18n/zh-Hans.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "noData": "暂无数据",
- "noNetwork": "网络异常",
- "toSet": "前往设置",
- "error": "错误"
-}
diff --git a/uni_modules/uni-cms-article/components/uni-load-state/readme.md b/uni_modules/uni-cms-article/components/uni-load-state/readme.md
deleted file mode 100644
index 07288d6..0000000
--- a/uni_modules/uni-cms-article/components/uni-load-state/readme.md
+++ /dev/null
@@ -1,3 +0,0 @@
-新增uni-load-state组件,这是一个封装数据请求状态的组件。根据uniCloud-db组件提供的参数直接响应对应的效果。
-包括加载中、当前页面为空、没有更多数据、上拉加载更多;
-加载错误判断,如果是断网就引导打开系统网络设置页面。恢复联网后自动触发networkResume方法。
\ No newline at end of file
diff --git a/uni_modules/uni-cms-article/components/uni-load-state/uni-load-state.vue b/uni_modules/uni-cms-article/components/uni-load-state/uni-load-state.vue
deleted file mode 100644
index ec99b24..0000000
--- a/uni_modules/uni-cms-article/components/uni-load-state/uni-load-state.vue
+++ /dev/null
@@ -1,171 +0,0 @@
-
-
-
-
-
- {{noNetwork}}
-
- {{toSet}}
-
-
- {{error}}:{{JSON.stringify(state.error)}}
-
-
-
- {{state.loading?'加载中...':(state.hasMore?'上拉加载更多':'没有更多数据了')}}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/license.md b/uni_modules/uni-cms-article/license.md
deleted file mode 100644
index ad29f83..0000000
--- a/uni_modules/uni-cms-article/license.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# uni-cms源码使用许可协议
-
-2022年10月
-
-本许可协议,是数字天堂(北京)网络技术有限公司(以下简称DCloud)对其所拥有著作权的“DCloud uni-cms”(以下简称软件),提供的使用许可协议。
-
-您对“软件”的复制、使用、修改及分发受本许可协议的条款的约束,如您不接受本协议,则不能使用、复制、修改本软件。
-
-**授权许可范围**
-
-a) 授予您永久性的、全球性的、免费的、非独占的、不可撤销的本软件的源码使用许可,您可以使用这些源码制作自己的应用。
-
-b) 您只能在DCloud产品体系内使用本软件及其源码。您不能将源码修改后运行在DCloud产品体系之外的环境,比如客户端脱离uni-app,或服务端脱离uniCloud。
-
-c) DCloud未向您授权商标使用许可。您在根据本软件源码制作自己的应用时,需以自己的名义发布软件,而不是以DCloud名义发布。
-
-d) 本协议不构成代理关系。
-
-DCloud的责任限制 “软件”在提供时不带任何明示或默示的担保。在任何情况下,DCloud不对任何人因使用“软件”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。
-
-**您的责任限制**
-
-a) 您需要在授权许可范围内使用软件。
-
-b) 您在分发自己的应用时,不得侵犯DCloud商标和名誉权利。
-
-c) 您不得进行破解、反编译、套壳等侵害DCloud知识产权的行为。您不得利用DCloud系统漏洞谋利或侵害DCloud利益,如您发现DCloud系统漏洞应第一时间通知DCloud。您不得进行攻击DCloud的服务器、网络等妨碍DCloud运营的行为。您不得利用DCloud的产品进行与DCloud争夺开发者的行为。
-
-d) 如您违反本许可协议,需承担因此给DCloud造成的损失。
-
-本协议签订地点为中华人民共和国北京市海淀区。
-
-根据发展,DCloud可能会对本协议进行修改。修改时,DCloud会在产品或者网页中显著的位置发布相关信息以便及时通知到用户。如果您选择继续使用本框架,即表示您同意接受这些修改。
-
-条款结束
diff --git a/uni_modules/uni-cms-article/package.json b/uni_modules/uni-cms-article/package.json
deleted file mode 100644
index 8efd310..0000000
--- a/uni_modules/uni-cms-article/package.json
+++ /dev/null
@@ -1,90 +0,0 @@
-{
- "id": "uni-cms-article",
- "displayName": "uni-cms-article",
- "version": "1.0.16",
- "description": "uni-cms的用户端,包括文章展示、搜索、看广告解锁等功能",
- "keywords": [
- "uni-cms-article",
- "cms",
- "uni-cms",
- "内容管理",
- "文章"
-],
- "repository": "",
- "engines": {
- "HBuilderX": "^3.1.0"
- },
- "dcloudext": {
- "type": "uniapp-template-page",
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": ""
- },
- "uni_modules": {
- "dependencies": [
- "uni-search-bar",
- "uni-nav-bar",
- "uni-list"
- ],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y",
- "alipay": "y"
- },
- "client": {
- "Vue": {
- "vue2": "y",
- "vue3": "y"
- },
- "App": {
- "app-vue": "y",
- "app-nvue": "y"
- },
- "H5-mobile": {
- "Safari": "y",
- "Android Browser": "y",
- "微信浏览器(Android)": "y",
- "QQ浏览器(Android)": "y"
- },
- "H5-pc": {
- "Chrome": "y",
- "IE": "u",
- "Edge": "y",
- "Firefox": "y",
- "Safari": "y"
- },
- "小程序": {
- "微信": "y",
- "阿里": "u",
- "百度": "u",
- "字节跳动": "u",
- "QQ": "u",
- "钉钉": "u",
- "快手": "u",
- "飞书": "u",
- "京东": "u"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- }
- }
- }
- }
-}
diff --git a/uni_modules/uni-cms-article/pages/detail/detail.uvue b/uni_modules/uni-cms-article/pages/detail/detail.uvue
deleted file mode 100644
index 3e773af..0000000
--- a/uni_modules/uni-cms-article/pages/detail/detail.uvue
+++ /dev/null
@@ -1,223 +0,0 @@
-
-
-
-
- {{ articleDetail.title }}
-
-
- {{ articleDetail.excerpt }}
-
-
-
- {{ articleDetail.user_id?.nickname ?? '' }}
- ·
-
- {{ publishTime(articleDetail.publish_date as number) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/pages/detail/detail.vue b/uni_modules/uni-cms-article/pages/detail/detail.vue
deleted file mode 100644
index dee4c3c..0000000
--- a/uni_modules/uni-cms-article/pages/detail/detail.vue
+++ /dev/null
@@ -1,217 +0,0 @@
-
-
-
-
-
- {{ data.title }}
-
-
- {{ data.excerpt }}
-
-
-
- {{ data.user_id[0].nickname || '' }}
- ·
-
- {{ publishTime(data.publish_date) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/pages/detail/preview.vue b/uni_modules/uni-cms-article/pages/detail/preview.vue
deleted file mode 100644
index 80c8004..0000000
--- a/uni_modules/uni-cms-article/pages/detail/preview.vue
+++ /dev/null
@@ -1,255 +0,0 @@
-
-
-
- 此页面仅用于临时预览文章,链接将会在短期内失效。
-
-
- {{ articleData.title }}
-
-
- {{ articleData.excerpt }}
-
-
-
- {{ articleData.user_id[0].nickname || '' }}
- ·
-
- {{ publishTime(articleData.publish_date) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/pages/list/list.nvue b/uni_modules/uni-cms-article/pages/list/list.nvue
deleted file mode 100644
index 2950aba..0000000
--- a/uni_modules/uni-cms-article/pages/list/list.nvue
+++ /dev/null
@@ -1,298 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/pages/list/list.uvue b/uni_modules/uni-cms-article/pages/list/list.uvue
deleted file mode 100644
index 5d89d29..0000000
--- a/uni_modules/uni-cms-article/pages/list/list.uvue
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/pages/search/search.nvue b/uni_modules/uni-cms-article/pages/search/search.nvue
deleted file mode 100644
index 938e0fc..0000000
--- a/uni_modules/uni-cms-article/pages/search/search.nvue
+++ /dev/null
@@ -1,752 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ word }}
-
-
-
-
-
-
-
-
- 正在加载...
-
-
- {{ error.message }}
-
- {{ word.content }}
-
-
-
- 当前搜索发现已隐藏
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.title }}
-
- {{ item.user_id[0] ? item.user_id[0].nickname : '' }}
- {{ publishTime(item.publish_date) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/pages/search/search.uvue b/uni_modules/uni-cms-article/pages/search/search.uvue
deleted file mode 100644
index 0c4c059..0000000
--- a/uni_modules/uni-cms-article/pages/search/search.uvue
+++ /dev/null
@@ -1,363 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- 搜索历史
-
-
-
- 全部删除
- 完成
-
-
-
-
-
- {{text}}
-
-
-
-
-
-
-
-
- 搜索发现
-
-
-
-
-
-
- 正在加载...
-
-
- {{error.message}}
-
-
- 当前搜索发现已隐藏
-
-
-
- {{ word.getString('content') }}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/pages/webview/webview.uvue b/uni_modules/uni-cms-article/pages/webview/webview.uvue
deleted file mode 100644
index ff72a6a..0000000
--- a/uni_modules/uni-cms-article/pages/webview/webview.uvue
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/pages/webview/webview.vue b/uni_modules/uni-cms-article/pages/webview/webview.vue
deleted file mode 100644
index 1597281..0000000
--- a/uni_modules/uni-cms-article/pages/webview/webview.vue
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/uni_modules/uni-cms-article/readme.md b/uni_modules/uni-cms-article/readme.md
deleted file mode 100644
index 983d5e8..0000000
--- a/uni_modules/uni-cms-article/readme.md
+++ /dev/null
@@ -1,24 +0,0 @@
-# uni-cms-article
-
-uni-CMS是基于uniCloud开发的uni-admin插件,可用于快速搭建CMS内容管理系统。
-客户端可使用 uni-cms-article 插件进行内容展示,无需开发,即可在多端展示内容。
-
-
-
-
-
-
-
----
-
-## 详细文档请在 [uni-cms 文档](https://uniapp.dcloud.net.cn/uniCloud/uni-cms.html) 中查看
diff --git a/uni_modules/uni-cms-article/static/disconnection.png b/uni_modules/uni-cms-article/static/disconnection.png
deleted file mode 100644
index 8b99603..0000000
Binary files a/uni_modules/uni-cms-article/static/disconnection.png and /dev/null differ
diff --git a/uni_modules/uni-cms-article/static/uniicons.ttf b/uni_modules/uni-cms-article/static/uniicons.ttf
deleted file mode 100644
index 835f33b..0000000
Binary files a/uni_modules/uni-cms-article/static/uniicons.ttf and /dev/null differ
diff --git a/uni_modules/uni-cms-article/uniCloud/cloudfunctions/common/quill-delta-converter/core.js b/uni_modules/uni-cms-article/uniCloud/cloudfunctions/common/quill-delta-converter/core.js
deleted file mode 100644
index fe69a4e..0000000
--- a/uni_modules/uni-cms-article/uniCloud/cloudfunctions/common/quill-delta-converter/core.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";var t,e,n,r,i,o="\n";exports.ListType=void 0,(t=exports.ListType||(exports.ListType={})).Ordered="ordered",t.Bullet="bullet",t.Checked="checked",t.Unchecked="unchecked",exports.ScriptType=void 0,(e=exports.ScriptType||(exports.ScriptType={})).Sub="sub",e.Super="super",exports.DirectionType=void 0,(exports.DirectionType||(exports.DirectionType={})).Rtl="rtl",exports.AlignType=void 0,(n=exports.AlignType||(exports.AlignType={})).Left="left",n.Center="center",n.Right="right",n.Justify="justify",exports.DataType=void 0,(r=exports.DataType||(exports.DataType={})).Image="image",r.Video="video",r.Formula="formula",r.Text="text",exports.GroupType=void 0,(i=exports.GroupType||(exports.GroupType={})).Block="block",i.InlineGroup="inline-group",i.List="list",i.Video="video",i.Table="table";var s=function(t,e){this.type=t,this.value=e},a=function(t,e){this.type=t,this.value=e},u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var p={exports:{}};!function(t,e){var n="__lodash_hash_undefined__",r=1,i=2,o=9007199254740991,s="[object Arguments]",a="[object Array]",c="[object AsyncFunction]",p="[object Boolean]",l="[object Date]",f="[object Error]",h="[object Function]",d="[object GeneratorFunction]",y="[object Map]",g="[object Number]",m="[object Null]",b="[object Object]",v="[object Promise]",T="[object Proxy]",k="[object RegExp]",_="[object Set]",C="[object String]",A="[object Symbol]",x="[object Undefined]",w="[object WeakMap]",L="[object ArrayBuffer]",B="[object DataView]",S=/^\[object .+?Constructor\]$/,j=/^(?:0|[1-9]\d*)$/,I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I[s]=I[a]=I[L]=I[p]=I[B]=I[l]=I[f]=I[h]=I[y]=I[g]=I[b]=I[k]=I[_]=I[C]=I[w]=!1;var O="object"==typeof u&&u&&u.Object===Object&&u,z="object"==typeof self&&self&&self.Object===Object&&self,V=O||z||Function("return this")(),H=e&&!e.nodeType&&e,D=H&&t&&!t.nodeType&&t,R=D&&D.exports===H,P=R&&O.process,E=function(){try{return P&&P.binding&&P.binding("util")}catch(t){}}(),G=E&&E.isTypedArray;function F(t,e){for(var n=-1,r=null==t?0:t.length;++nc))return!1;var l=a.get(t);if(l&&a.get(e))return l==e;var f=-1,h=!0,d=n&i?new Lt:void 0;for(a.set(t,e),a.set(e,t);++f-1},xt.prototype.set=function(t,e){var n=this.__data__,r=jt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},wt.prototype.clear=function(){this.size=0,this.__data__={hash:new At,map:new(ft||xt),string:new At}},wt.prototype.delete=function(t){var e=Pt(this,t).delete(t);return this.size-=e?1:0,e},wt.prototype.get=function(t){return Pt(this,t).get(t)},wt.prototype.has=function(t){return Pt(this,t).has(t)},wt.prototype.set=function(t,e){var n=Pt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Lt.prototype.add=Lt.prototype.push=function(t){return this.__data__.set(t,n),this},Lt.prototype.has=function(t){return this.__data__.has(t)},Bt.prototype.clear=function(){this.__data__=new xt,this.size=0},Bt.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Bt.prototype.get=function(t){return this.__data__.get(t)},Bt.prototype.has=function(t){return this.__data__.has(t)},Bt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof xt){var r=n.__data__;if(!ft||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new wt(r)}return n.set(t,e),this.size=n.size,this};var Gt=ut?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n-1&&t%1==0&&t-1&&t%1==0&&t<=o}function Qt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Kt(t){return null!=t&&"object"==typeof t}var Xt=G?function(t){return function(e){return t(e)}}(G):function(t){return Kt(t)&&Zt(t.length)&&!!I[It(t)]};function Yt(t){return null!=(e=t)&&Zt(e.length)&&!Jt(e)?St(t):Ht(t);var e}t.exports=function(t,e){return zt(t,e)}}(p,p.exports);var l,f=c(p.exports),h=function(){function t(t,e){"string"==typeof t&&(t=new s(exports.DataType.Text,t+"")),this.insert=t,this.attributes=e||{}}return t.createNewLineOp=function(){return new t(o)},t.prototype.isContainerBlock=function(){return this.isBlockquote()||this.isList()||this.isTable()||this.isCodeBlock()||this.isHeader()||this.isBlockAttribute()||this.isCustomTextBlock()},t.prototype.isBlockAttribute=function(){var t=this.attributes;return!!(t.align||t.direction||t.indent)},t.prototype.isBlockquote=function(){return!!this.attributes.blockquote},t.prototype.isHeader=function(){return!!this.attributes.header},t.prototype.isTable=function(){return!!this.attributes.table},t.prototype.isSameHeaderAs=function(t){return t.attributes.header===this.attributes.header&&this.isHeader()},t.prototype.hasSameAdiAs=function(t){return this.attributes.align===t.attributes.align&&this.attributes.direction===t.attributes.direction&&this.attributes.indent===t.attributes.indent},t.prototype.hasSameIndentationAs=function(t){return this.attributes.indent===t.attributes.indent},t.prototype.hasSameAttr=function(t){return f(this.attributes,t.attributes)},t.prototype.hasHigherIndentThan=function(t){return(Number(this.attributes.indent)||0)>(Number(t.attributes.indent)||0)},t.prototype.isInline=function(){return!(this.isContainerBlock()||this.isVideo()||this.isCustomEmbedBlock())},t.prototype.isCodeBlock=function(){return!!this.attributes["code-block"]},t.prototype.hasSameLangAs=function(t){return this.attributes["code-block"]===t.attributes["code-block"]},t.prototype.isJustNewline=function(){return this.insert.value===o},t.prototype.isList=function(){return this.isOrderedList()||this.isBulletList()||this.isCheckedList()||this.isUncheckedList()},t.prototype.isOrderedList=function(){return this.attributes.list===exports.ListType.Ordered},t.prototype.isBulletList=function(){return this.attributes.list===exports.ListType.Bullet},t.prototype.isCheckedList=function(){return this.attributes.list===exports.ListType.Checked},t.prototype.isUncheckedList=function(){return this.attributes.list===exports.ListType.Unchecked},t.prototype.isACheckList=function(){return this.attributes.list==exports.ListType.Unchecked||this.attributes.list===exports.ListType.Checked},t.prototype.isSameListAs=function(t){return!!t.attributes.list&&(this.attributes.list===t.attributes.list||t.isACheckList()&&this.isACheckList())},t.prototype.isSameTableRowAs=function(t){return!!t.isTable()&&this.isTable()&&this.attributes.table===t.attributes.table},t.prototype.isText=function(){return this.insert.type===exports.DataType.Text},t.prototype.isImage=function(){return this.insert.type===exports.DataType.Image},t.prototype.isFormula=function(){return this.insert.type===exports.DataType.Formula},t.prototype.isVideo=function(){return this.insert.type===exports.DataType.Video},t.prototype.isLink=function(){return this.isText()&&!!this.attributes.link},t.prototype.isCustomEmbed=function(){return this.insert instanceof a},t.prototype.isCustomEmbedBlock=function(){return this.isCustomEmbed()&&!!this.attributes.renderAsBlock},t.prototype.isCustomTextBlock=function(){return this.isText()&&!!this.attributes.renderAsBlock},t.prototype.isMentions=function(){return this.isText()&&!!this.attributes.mentions},t}(),d=function(t,e){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},d(t,e)};function y(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function g(){for(var t=0,e=0,n=arguments.length;e"),n?"<"+t+" "+n+r:"<"+t+r}function b(t){return void 0===t&&(t=""),t&&""+t+">"||""}function v(t,e){return void 0===e&&(e=!0),e&&(t=function(t){return T(l.Html).reduce(_,t)}(t)),T(l.Html).reduce(k,t)}function T(t){var e=[["&","&"],["<","<"],[">",">"],['"',"""],["'","'"],["\\/","/"],["\\(","("],["\\)",")"]];return t===l.Html?e.filter((function(t){var e=t[0];return t[1],-1===e.indexOf("(")&&-1===e.indexOf(")")})):e.filter((function(t){var e=t[0];return t[1],-1===e.indexOf("/")}))}function k(t,e){return t.replace(new RegExp(e[0],"g"),e[1])}function _(t,e){return t.replace(new RegExp(e[1],"g"),e[0].replace("\\",""))}"function"==typeof SuppressedError&&SuppressedError,function(t){t[t.Html=0]="Html",t[t.Url=1]="Url"}(l||(l={}));var C=function(){function t(){}return t.sanitize=function(t,e){var n=function(){};e&&"function"==typeof e.urlSanitizer&&(n=e.urlSanitizer);var r,i=n(t);return"string"==typeof i?i:function(t){var e=T(l.Url),n=e.reduce(_,t);return e.reduce(k,n)}((r=(r=t).replace(/^\s*/gm,""),/^((https?|s?ftp|file|blob|mailto|tel):|#|\/|data:image\/)/.test(r)?r:"unsafe:"+r))},t}(),A=function(){function t(){}return t.sanitize=function(e,n){var r={};return e&&"object"==typeof e?(e.class&&t.IsValidClass(e.class)&&(r.class=e.class),e.id&&t.IsValidId(e.id)&&(r.id=e.id),t.IsValidTarget(e.target+"")&&(r.target=e.target),e.avatar&&(r.avatar=C.sanitize(e.avatar+"",n)),e["end-point"]&&(r["end-point"]=C.sanitize(e["end-point"]+"",n)),e.slug&&(r.slug=e.slug+""),r):r},t.IsValidClass=function(t){return!!t.match(/^[a-zA-Z0-9_\-]{1,500}$/i)},t.IsValidId=function(t){return!!t.match(/^[a-zA-Z0-9_\-\:\.]{1,500}$/i)},t.IsValidTarget=function(t){return["_self","_blank","_parent","_top"].indexOf(t)>-1},t}();function x(t){return 0===t.length?null:t.length>=2?t[1]:t[0]}function w(t){return t.reduce((function(t,e){return t.concat(Array.isArray(e)?w(e):e)}),[])}function L(t,e){for(var n,r=[],i=0;i0&&e(n,t[i-1])?r[r.length-1].push(n):r.push([n]);return r.map((function(t){return 1===t.length?t[0]:t}))}function B(t,e,n){for(var r={elements:[],sliceStartsAt:-1},i=e;i>=0&&n(t[i]);i--)r.sliceStartsAt=i,r.elements.unshift(t[i]);return r}var S=function(){function t(){}return t.sanitize=function(e,n){var r={};if(!e||"object"!=typeof e)return r;var i=["bold","italic","underline","strike","code","blockquote","code-block","renderAsBlock"],o=["background","color"],s=e.font,a=e.size,u=e.link,c=e.script,p=e.list,l=e.header,f=e.align,h=e.direction,d=e.indent,y=e.mentions,m=e.mention,b=e.width,v=e.target,T=e.rel,k=e["code-block"],_=g(i,o,["font","size","link","script","list","header","align","direction","indent","mentions","mention","width","target","rel","code-block"]);if(i.forEach((function(t){var n=e[t];n&&(r[t]=!!n)})),o.forEach((function(n){var i=e[n];i&&(t.IsValidHexColor(i+"")||t.IsValidColorLiteral(i+"")||t.IsValidRGBColor(i+""))&&(r[n]=i)})),s&&t.IsValidFontName(s+"")&&(r.font=s),a&&t.IsValidSize(a+"")&&(r.size=a),b&&t.IsValidWidth(b+"")&&(r.width=b),u&&(r.link=C.sanitize(u+"",n)),v&&t.isValidTarget(v)&&(r.target=v),T&&t.IsValidRel(T)&&(r.rel=T),k&&(t.IsValidLang(k)?r["code-block"]=k:r["code-block"]=!!k),c!==exports.ScriptType.Sub&&exports.ScriptType.Super!==c||(r.script=c),p!==exports.ListType.Bullet&&p!==exports.ListType.Ordered&&p!==exports.ListType.Checked&&p!==exports.ListType.Unchecked||(r.list=p),Number(l)&&(r.header=Math.min(Number(l),6)),function(t,e){if(Array.prototype.find)return Array.prototype.find.call(t,e);for(var n=0;n0&&(r.mentions=!!y,r.mention=m)}return Object.keys(e).reduce((function(t,n){return-1===_.indexOf(n)&&(t[n]=e[n]),t}),r)},t.IsValidHexColor=function(t){return!!t.match(/^#([0-9A-F]{6}|[0-9A-F]{3})$/i)},t.IsValidColorLiteral=function(t){return!!t.match(/^[a-z]{1,50}$/i)},t.IsValidRGBColor=function(t){return!!t.match(/^rgb\(((0|25[0-5]|2[0-4]\d|1\d\d|0?\d?\d),\s*){2}(0|25[0-5]|2[0-4]\d|1\d\d|0?\d?\d)\)$/i)},t.IsValidFontName=function(t){return!!t.match(/^[a-z\s0-9\- ]{1,30}$/i)},t.IsValidSize=function(t){return!!t.match(/^[a-z0-9\-]{1,20}$/i)},t.IsValidWidth=function(t){return!!t.match(/^[0-9]*(px|em|%)?$/)},t.isValidTarget=function(t){return!!t.match(/^[_a-zA-Z0-9\-]{1,50}$/)},t.IsValidRel=function(t){return!!t.match(/^[a-zA-Z\s\-]{1,250}$/i)},t.IsValidLang=function(t){return"boolean"==typeof t||!!t.match(/^[a-zA-Z\s\-\\\/\+]{1,50}$/i)},t}();function j(t){for(var e=[],n=1;n=0;o--){var s=t[o];s.isVideo()?n.push(new P(s)):s.isCustomEmbedBlock()?n.push(new E(s)):s.isContainerBlock()?(e=B(t,o-1,r),n.push(new G(s,e.elements)),o=e.sliceStartsAt>-1?e.sliceStartsAt:o):(e=B(t,o-1,i),n.push(new D(e.elements.concat(s))),o=e.sliceStartsAt>-1?e.sliceStartsAt:o)}return n.reverse(),n},t.groupConsecutiveSameStyleBlocks=function(e,n){return void 0===n&&(n={header:!0,codeBlocks:!0,blockquotes:!0,customBlocks:!0}),L(e,(function(e,r){return e instanceof G&&r instanceof G&&(n.codeBlocks&&t.areBothCodeblocksWithSameLang(e,r)||n.blockquotes&&t.areBothBlockquotesWithSameAdi(e,r)||n.header&&t.areBothSameHeadersWithSameAdi(e,r)||n.customBlocks&&t.areBothCustomBlockWithSameAttr(e,r))}))},t.reduceConsecutiveSameStyleBlocksToOne=function(t){var e=h.createNewLineOp();return t.map((function(t){if(!Array.isArray(t))return t instanceof G&&!t.ops.length&&t.ops.push(e),t;var n=t.length-1;return t[0].ops=w(t.map((function(t,r){return t.ops.length?t.ops.concat(r=0;n--){var r=e[n];if(t.items[0].item.op.hasHigherIndentThan(r.items[0].item.op)){var i=r.items[r.items.length-1];return i.innerList?i.innerList.items=i.innerList.items.concat(t.items):i.innerList=t,!0}}return!1},t}(),J=function(){function t(){}return t.prototype.group=function(t){return this.convertTableBlocksToTableGroups(t)},t.prototype.convertTableBlocksToTableGroups=function(t){var e=this;return L(t,(function(t,e){return t instanceof G&&e instanceof G&&t.op.isTable()&&e.op.isTable()})).map((function(t){return Array.isArray(t)?new N(e.convertTableBlocksToTableRows(t)):t instanceof G&&t.op.isTable()?new N([new U([new $(t)])]):t}))},t.prototype.convertTableBlocksToTableRows=function(t){return L(t,(function(t,e){return t instanceof G&&e instanceof G&&t.op.isTable()&&e.op.isTable()&&t.op.isSameTableRowAs(e.op)})).map((function(t){return new U(Array.isArray(t)?t.map((function(t){return new $(t)})):[new $(t)])}))},t}(),Z="
",Q=function(){function t(t,e){var n;this.rawDeltaOps=[],this.callbacks={},this.options=j({paragraphTag:"p",encodeHtml:!0,classPrefix:"ql",inlineStyles:!1,multiLineBlockquote:!0,multiLineHeader:!0,multiLineCodeblock:!0,multiLineParagraph:!0,multiLineCustomBlock:!0,allowBackgroundClasses:!1,linkTarget:"_blank"},e,{orderedListTag:"ol",bulletListTag:"ul",listItemTag:"li"}),n=this.options.inlineStyles?"object"==typeof this.options.inlineStyles?this.options.inlineStyles:{}:void 0,this.converterOptions={encodeHtml:this.options.encodeHtml,classPrefix:this.options.classPrefix,inlineStyles:n,listItemTag:this.options.listItemTag,paragraphTag:this.options.paragraphTag,linkRel:this.options.linkRel,linkTarget:this.options.linkTarget,allowBackgroundClasses:this.options.allowBackgroundClasses,customTag:this.options.customTag,customTagAttributes:this.options.customTagAttributes,customCssClasses:this.options.customCssClasses,customCssStyles:this.options.customCssStyles},this.rawDeltaOps=t}return t.prototype._getListTag=function(t){return t.isOrderedList()?this.options.orderedListTag+"":t.isBulletList()||t.isCheckedList()||t.isUncheckedList()?this.options.bulletListTag+"":""},t.prototype.getGroupedOps=function(){var t=O.convert(this.rawDeltaOps,this.options),e=q.pairOpsWithTheirBlock(t),n=q.groupConsecutiveSameStyleBlocks(e,{blockquotes:!!this.options.multiLineBlockquote,header:!!this.options.multiLineHeader,codeBlocks:!!this.options.multiLineCodeblock,customBlocks:!!this.options.multiLineCustomBlock}),r=q.reduceConsecutiveSameStyleBlocksToOne(n);return r=(new J).group(r),(new M).nest(r)},t.prototype.convert=function(){var t=this;return this.getGroupedOps().map((function(e){if(e instanceof F)return t._renderWithCallbacks(exports.GroupType.List,e,(function(){return t._renderList(e)}));if(e instanceof N)return t._renderWithCallbacks(exports.GroupType.Table,e,(function(){return t._renderTable(e)}));if(e instanceof G){var n=e;return t._renderWithCallbacks(exports.GroupType.Block,e,(function(){return t._renderBlock(n.op,n.ops)}))}return e instanceof E?t._renderCustom(e.op,null):e instanceof P?t._renderWithCallbacks(exports.GroupType.Video,e,(function(){return new H(e.op,t.converterOptions).getHtml()})):t._renderWithCallbacks(exports.GroupType.InlineGroup,e,(function(){return t._renderInlines(e.ops,!0)}))})).join("")},t.prototype._renderWithCallbacks=function(t,e,n){var r="",i=this.callbacks.beforeRender_cb;(r="function"==typeof i?i.apply(null,[t,e]):"")||(r=n());var o=this.callbacks.afterRender_cb;return r="function"==typeof o?o.apply(null,[t,r]):r},t.prototype._renderList=function(t){var e=this,n=t.items[0];return m(this._getListTag(n.item.op))+t.items.map((function(t){return e._renderListItem(t)})).join("")+b(this._getListTag(n.item.op))},t.prototype._renderListItem=function(t){t.item.op.attributes.indent=0;var e=new H(t.item.op,this.converterOptions).getHtmlParts(),n=this._renderInlines(t.item.ops,!1);return e.openingTag+n+(t.innerList?this._renderList(t.innerList):"")+e.closingTag},t.prototype._renderTable=function(t){var e=this;return m("table")+m("tbody")+t.rows.map((function(t){return e._renderTableRow(t)})).join("")+b("tbody")+b("table")},t.prototype._renderTableRow=function(t){var e=this;return m("tr")+t.cells.map((function(t){return e._renderTableCell(t)})).join("")+b("tr")},t.prototype._renderTableCell=function(t){var e=new H(t.item.op,this.converterOptions).getHtmlParts(),n=this._renderInlines(t.item.ops,!1);return m("td",{key:"data-row",value:t.item.op.attributes.table})+e.openingTag+n+e.closingTag+b("td")},t.prototype._renderBlock=function(t,e){var n=this,r=new H(t,this.converterOptions).getHtmlParts();if(t.isCodeBlock())return r.openingTag+v(e.map((function(e){return e.isCustomEmbed()?n._renderCustom(e,t):e.insert.value})).join(""))+r.closingTag;var i=e.map((function(e){return n._renderInline(e,t)})).join("");return r.openingTag+(i||Z)+r.closingTag},t.prototype._renderInlines=function(t,e){var n=this;void 0===e&&(e=!0);var r=t.length-1,i=t.map((function(t,e){return e>0&&e===r&&t.isJustNewline()?"":n._renderInline(t,null)})).join("");if(!e)return i;var o=m(this.options.paragraphTag),s=b(this.options.paragraphTag);return i===Z||this.options.multiLineParagraph?o+i+s:o+i.split(Z).map((function(t){return""===t?Z:t})).join(s+o)+s},t.prototype._renderInline=function(t,e){return t.isCustomEmbed()?this._renderCustom(t,e):new H(t,this.converterOptions).getHtml().replace(/\n/g,Z)},t.prototype._renderCustom=function(t,e){var n=this.callbacks.renderCustomOp_cb;return"function"==typeof n?n.apply(null,[t,e]):""},t.prototype.beforeRender=function(t){"function"==typeof t&&(this.callbacks.beforeRender_cb=t)},t.prototype.afterRender=function(t){"function"==typeof t&&(this.callbacks.afterRender_cb=t)},t.prototype.renderCustomWith=function(t){this.callbacks.renderCustomOp_cb=t},t}();exports.BlockGroup=G,exports.BlotBlock=E,exports.DeltaInsertOp=h,exports.InlineGroup=D,exports.InsertDataCustom=a,exports.InsertDataQuill=s,exports.ListGroup=F,exports.ListItem=W,exports.NewLine=o,exports.OpToHtmlConverter=H,exports.QuillDeltaToHtmlConverter=Q,exports.VideoItem=P;
diff --git a/uni_modules/uni-cms-article/uniCloud/cloudfunctions/common/quill-delta-converter/index.js b/uni_modules/uni-cms-article/uniCloud/cloudfunctions/common/quill-delta-converter/index.js
deleted file mode 100644
index 5011362..0000000
--- a/uni_modules/uni-cms-article/uniCloud/cloudfunctions/common/quill-delta-converter/index.js
+++ /dev/null
@@ -1,257 +0,0 @@
-const {
- QuillDeltaToHtmlConverter: QuillDeltaToHtmlConverterBase,
- BlockGroup,
- ListGroup,
- BlotBlock,
-} = require('./core')
-
-const jsonRules = {
- list(list) {
- const firstItem = list.items[0];
-
- return {
- type: "list",
- data: {
- type: firstItem.item.op.attributes.list,
- items: list.items.map((item) => jsonRules.listItem(item)),
- },
- attributes: firstItem.item.op.attributes,
- class: attributes2class(firstItem.item.op.attributes, 'block'),
- style: attributes2style(firstItem.item.op.attributes, 'block'),
- };
- },
- listItem(listItem) {
- // listItem.item.op.attributes.indent = 0;
- const inlines = jsonRules.inlines(listItem.item.op, listItem.item.ops, false).map((v) => v.ops)
-
- return {
- data: inlines[0] || [],
- children: listItem.innerList ? jsonRules.list(listItem.innerList): [],
- }
- },
- block (op, ops) {
- const type = ops[0].insert.type
-
- if (type === 'text') {
- return jsonRules.inlines(op, ops)
- }
-
- return {
- type: ops[0].insert.type,
- data: ops.map(bop => jsonRules.inline(bop)),
- attributes: op.attributes,
- class: attributes2class(op.attributes, 'block'),
- style: attributes2style(op.attributes, 'block'),
- }
- },
- inlines(op = {}, ops, isInlineGroup = true) {
- const opsLen = ops.length - 1;
- const br = {
- type: 'br'
- }
- const texts = ops.reduce((acc, op, i) => {
- if (i > 0 && i === opsLen && op.isJustNewline()) {
- acc[acc.length - 1].op = op
- return acc;
- }
-
- if (!acc[acc.length - 1]) {
- acc.push({ops: [], op: {}});
- }
-
- if (op.isJustNewline()) {
- const nextOp = ops[i + 1];
- acc[acc.length - 1].op = op
- if (nextOp && nextOp.isJustNewline()) {
- acc.push({ops: [br], op: {}});
- } else {
- acc.push({ops: [], op: {}});
- }
- return acc;
- } else {
- acc[acc.length - 1].ops.push(jsonRules.inline(op));
- return acc;
- }
- }, []);
-
- if (!isInlineGroup) {
- return texts;
- }
-
- return texts.map((v) => {
- return {
- type: "paragraph",
- data: v.ops,
- class: attributes2class(op.attributes || v.op.attributes, 'block'),
- style: attributes2style(op.attributes || v.op.attributes, 'block'),
- };
- });
- },
- inline (op) {
- const data = {
- value: op.insert.value,
- attributes: op.attributes,
- class: attributes2class(op.attributes, 'inline'),
- style: attributes2style(op.attributes, 'inline'),
- }
-
- if (op.isCustomEmbed()) {
- return {
- type: op.insert.type,
- data
- }
- }
-
- if (op.isLink()) {
- return {
- type: 'link',
- data
- }
- }
-
- return {
- type: op.isImage() ? "image": "text",
- data
- }
- },
- blotBlock (op) {
- return {
- type: op.insert.type,
- data: {
- value: op.insert.value,
- attributes: op.attributes,
- class: attributes2class(op.attributes, 'block'),
- style: attributes2style(op.attributes, 'block'),
- }
- }
- }
-};
-
-function attributes2style(attributes, type) {
- if (!attributes) return ''
- // 定义允许的属性
- const allowAttr = {
- inline: ['align', 'color', 'background', 'font', 'fontSize', 'fontStyle', 'fontVariant', 'fontWeight', 'fontFamily', 'lineHeight', 'letterSpacing', 'textDecoration', 'textIndent', 'wordWrap', 'wordBreak', 'whiteSpace'],
- block: ['align', 'margin', 'marginTop', 'marginBottom', 'marginLeft', 'marginRight', 'padding', 'paddingTop', 'paddingBottom', 'paddingLeft', 'paddingRight', 'lineHeight', 'textIndent']
- }[type]
-
- // 定义属性适配器
- const adp = {
- align: 'text-align',
- }
-
- // 如果不支持该类型的属性,则抛出错误
- if (!allowAttr) throw new Error('type not supported')
-
- // 将属性转换为style
- return allowAttr.reduce((res, item) => {
- // 如果属性为空,则返回空字符串
- if (!attributes) return res
- // 如果属性不为undefined,则将属性名和属性值添加到style列表中
- if (attributes[item] !== undefined) {
- // 如果属性适配器中存在该属性,则使用适配器中的属性名
- // 否则,将属性名转换为短横线连接的形式
- res.push(`${adp[item] || item.replace(/([A-Z])/g, (s, m) => `-${m.toLowerCase()}`)}: ${attributes[item]}`)
- }
- return res
-
- }, []).join(';')
-}
-function attributes2class(attributes, type) {
- if (!attributes) return ''
- // 定义允许的属性
- const allowAttr = {
- inline: ['bold', 'italic', 'underline', 'strike', 'ins', 'link'],
- block: ['header', 'list']
- }[type]
-
- // 如果不支持该类型的属性,则抛出错误
- if (!allowAttr) throw new Error('type not supported')
-
- // 将属性转换为class列表
- const classList = allowAttr.reduce((res, item) => {
- // 如果属性为空,则返回空字符串
- if (!attributes || item === "link") return res
- // 如果属性为true,则将属性名添加到class列表中
- if (attributes[item] === true) {
- res.push(item)
- // 如果属性不为undefined,则将属性名和属性值添加到class列表中
- } else if (attributes[item] !== undefined) {
- res.push(`${item}-${attributes[item]}`)
- }
- return res
-
- }, [])
-
- // 如果属性中包含link,则添加link类
- if ('link' in attributes) {
- classList.push('link')
- }
-
- return classList.join(' ')
-}
-class QuillDeltaToJSONConverter {
- constructor(deltaOps) {
-
- this.deltaPreHandler(deltaOps)
-
- this.deltaOps = deltaOps
- this.converter = new QuillDeltaToHtmlConverterBase(this.deltaOps, {
- multiLineParagraph: false,
- });
- }
-
- deltaPreHandler (deltaOps) {
- for (const op of deltaOps) {
- if (typeof op.insert === 'string') continue
-
- if (!op.attributes) {
- op.attributes = {}
- }
-
- const insertType = Object.keys(op.insert)
- const blockRenderList = ['divider', 'unlockContent', 'mediaVideo']
-
- if (insertType && insertType.length > 0 && blockRenderList.includes(insertType[0])) {
- op.attributes.renderAsBlock = true
- }
- }
- }
-
- convert () {
- const opsGroups = this.converter.getGroupedOps();
-
- return [].concat.apply(
- [],
- opsGroups.map((group) => {
- // console.log(JSON.stringify(group), '--------------------group------------------------------')
- switch (group.constructor) {
- case ListGroup:
- return jsonRules.list(group);
- case BlockGroup:
- return jsonRules.block(group.op, group.ops)
- case BlotBlock:
- return jsonRules.blotBlock(group.op, group.ops)
- default:
- return jsonRules.inlines(group.op, group.ops);
- }
- })
- ).filter(op => op.data instanceof Array ? op.data.length : op.data);
- }
-}
-
-class QuillDeltaToHtmlConverter extends QuillDeltaToHtmlConverterBase {
- constructor(deltaOps) {
- super(deltaOps, {
- multiLineParagraph: false,
- inlineStyles: true,
- });
-
- // this.renderCustomWith(function (customOp, contextOp) {
- // console.log(customOp, contextOp)
- // })
- }
-}
-
-exports.QuillDeltaToHtmlConverter = QuillDeltaToHtmlConverter
-exports.QuillDeltaToJSONConverter = QuillDeltaToJSONConverter
diff --git a/uni_modules/uni-cms-article/uniCloud/cloudfunctions/common/quill-delta-converter/package.json b/uni_modules/uni-cms-article/uniCloud/cloudfunctions/common/quill-delta-converter/package.json
deleted file mode 100644
index b3b52e4..0000000
--- a/uni_modules/uni-cms-article/uniCloud/cloudfunctions/common/quill-delta-converter/package.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "name": "quill-delta-converter",
- "description": "quill编辑器delta格式转换器",
- "main": "index.js"
-}
diff --git a/uni_modules/uni-cms-article/uniCloud/cloudfunctions/uni-cms-unlock-callback/index.js b/uni_modules/uni-cms-article/uniCloud/cloudfunctions/uni-cms-unlock-callback/index.js
deleted file mode 100644
index 4d83748..0000000
--- a/uni_modules/uni-cms-article/uniCloud/cloudfunctions/uni-cms-unlock-callback/index.js
+++ /dev/null
@@ -1,58 +0,0 @@
-const crypto = require('crypto')
-const createConfig = require('uni-config-center')
-const config = createConfig({
- pluginId: 'uni-cms'
-}).config()
-
-const unlockRecordDBName = 'uni-cms-unlock-record'
-
-// 定义云函数
-exports.main = async function (event) {
- // 解构 event 对象
- const {trans_id, extra: _extra, sign} = event
- let extra = {}
- try {
- extra = JSON.parse(_extra)
- } catch (e) {}
-
- // 如果 adConfig 或 securityKey 配置项不存在,则抛出错误引导用户配置参数
- if (!config.adConfig || !config.adConfig.securityKey) throw new Error('请先配置adConfig.securityKey')
- // 如果 extra.article_id 不存在,则返回 null
- if (!extra.article_id) return null
-
- // 签名验证
- const reSign = crypto.createHash('sha256').update(`${config.adConfig.securityKey}:${trans_id}`).digest('hex')
- if (sign !== reSign) {
- console.log('签名错误', `${config.adConfig.securityKey}:${trans_id}`)
- return null
- }
-
- // 获取数据库实例
- const db = uniCloud.database()
- // 查询解锁记录
- const unlockRecord = await db.collection(unlockRecordDBName).where({
- trans_id
- }).get()
-
- // 如果已经解锁过了,则返回 null
- if (unlockRecord.data.length) {
- console.log('已经解锁过了')
- return null // 已经解锁过了
- }
-
- // 添加解锁记录
- await db.collection(unlockRecordDBName).add({
- unique_id: extra.unique_id,
- unique_type: extra.unique_type,
- article_id: extra.article_id,
- trans_id,
- create_date: Date.now()
- })
-
- console.log('解锁成功')
-
- // 应广告规范,需返回 isValid 为 true
- return {
- isValid: true
- }
-}
diff --git a/uni_modules/uni-cms-article/uniCloud/cloudfunctions/uni-cms-unlock-callback/package.json b/uni_modules/uni-cms-article/uniCloud/cloudfunctions/uni-cms-unlock-callback/package.json
deleted file mode 100644
index 5164bac..0000000
--- a/uni_modules/uni-cms-article/uniCloud/cloudfunctions/uni-cms-unlock-callback/package.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "name": "uni-cms-unlock-callback",
- "dependencies": {
- "uni-config-center": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
- },
- "extensions": {}
-}
\ No newline at end of file
diff --git a/uni_modules/uni-cms-article/uniCloud/database/db_init.json b/uni_modules/uni-cms-article/uniCloud/database/db_init.json
deleted file mode 100644
index c00926f..0000000
--- a/uni_modules/uni-cms-article/uniCloud/database/db_init.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "uni-cms-unlock-record": {
- "data": [],
- "index": [
- {
- "IndexName": "unique_article_trans_",
- "MgoKeySchema": {
- "MgoIndexKeys": [{
- "Name": "unique_id",
- "Direction": "1"
- },{
- "Name": "article_id",
- "Direction": "1"
- },{
- "Name": "trans_id",
- "Direction": "1"
- }],
- "MgoIsUnique": false
- }
- }
- ]
- }
-}
diff --git a/uni_modules/uni-cms-article/uniCloud/database/opendb-search-hot.schema.json b/uni_modules/uni-cms-article/uniCloud/database/opendb-search-hot.schema.json
deleted file mode 100644
index 3476e07..0000000
--- a/uni_modules/uni-cms-article/uniCloud/database/opendb-search-hot.schema.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "bsonType": "object",
- "required": [
- "content",
- "count"
- ],
- "permission": {
- "read": true,
- "create": false,
- "update": false,
- "delete": false
- },
- "properties": {
- "_id": {
- "description": "ID,系统自动生成"
- },
- "content": {
- "bsonType": "string",
- "description": "搜索内容"
- },
- "count": {
- "bsonType": "int",
- "description": "搜索次数"
- },
- "create_date": {
- "bsonType": "timestamp",
- "description": "统计时间"
- }
- },
- "version": "0.0.1"
-}
\ No newline at end of file
diff --git a/uni_modules/uni-cms-article/uniCloud/database/opendb-search-log.schema.json b/uni_modules/uni-cms-article/uniCloud/database/opendb-search-log.schema.json
deleted file mode 100644
index c30c9d2..0000000
--- a/uni_modules/uni-cms-article/uniCloud/database/opendb-search-log.schema.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "bsonType": "object",
- "required": [
- "content"
- ],
- "permission": {
- "read": false,
- "create": true,
- "update": false,
- "delete": false
- },
- "properties": {
- "_id": {
- "description": "ID,系统自动生成"
- },
- "user_id": {
- "bsonType": "string",
- "description": "搜索人id,参考uni-id-users表"
- },
- "device_id": {
- "bsonType": "string",
- "description": "设备id"
- },
- "platform": {
- "bsonType": "string",
- "description": "设备平台,如:mp-weixin、app-plus等"
- },
- "content": {
- "bsonType": "string",
- "description": "搜索内容"
- },
- "ip": {
- "bsonType": "string",
- "description": "客户端IP地址",
- "forceDefaultValue": {
- "$env": "clientIP"
- }
- },
- "create_date": {
- "bsonType": "timestamp",
- "description": "统计时间"
- }
- },
- "version": "0.0.1"
-}
diff --git a/uni_modules/uni-cms-article/uniCloud/database/opendb-search-logs.schema.json b/uni_modules/uni-cms-article/uniCloud/database/opendb-search-logs.schema.json
deleted file mode 100644
index c30c9d2..0000000
--- a/uni_modules/uni-cms-article/uniCloud/database/opendb-search-logs.schema.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "bsonType": "object",
- "required": [
- "content"
- ],
- "permission": {
- "read": false,
- "create": true,
- "update": false,
- "delete": false
- },
- "properties": {
- "_id": {
- "description": "ID,系统自动生成"
- },
- "user_id": {
- "bsonType": "string",
- "description": "搜索人id,参考uni-id-users表"
- },
- "device_id": {
- "bsonType": "string",
- "description": "设备id"
- },
- "platform": {
- "bsonType": "string",
- "description": "设备平台,如:mp-weixin、app-plus等"
- },
- "content": {
- "bsonType": "string",
- "description": "搜索内容"
- },
- "ip": {
- "bsonType": "string",
- "description": "客户端IP地址",
- "forceDefaultValue": {
- "$env": "clientIP"
- }
- },
- "create_date": {
- "bsonType": "timestamp",
- "description": "统计时间"
- }
- },
- "version": "0.0.1"
-}
diff --git a/uni_modules/uni-cms-article/uniCloud/database/uni-cms-articles.schema.ext.js b/uni_modules/uni-cms-article/uniCloud/database/uni-cms-articles.schema.ext.js
deleted file mode 100644
index b6b7e1c..0000000
--- a/uni_modules/uni-cms-article/uniCloud/database/uni-cms-articles.schema.ext.js
+++ /dev/null
@@ -1,350 +0,0 @@
-// 获取配置
-const createConfig = safeRequire('uni-config-center')
-const {QuillDeltaToHtmlConverter, QuillDeltaToJSONConverter} = safeRequire('quill-delta-converter')
-const config = createConfig({
- pluginId: 'uni-cms'
-}).config()
-
-// 获取数据库实例
-const db = uniCloud.database()
-
-// 文章数据库名称
-const articleDBName = 'uni-cms-articles'
-
-// 解锁内容数据库名称
-const unlockContentDBName = 'uni-cms-unlock-record'
-
-// 安全检测文本内容
-async function checkContentSec(content, requestId, errorMsg) {
- // 安全引入内容安全检测模块
- const UniSecCheck = safeRequire('uni-sec-check')
- // 创建内容安全检测实例
- const uniSecCheck = new UniSecCheck({
- provider: 'mp-weixin',
- requestId
- })
- // 调用文本安全检测接口
- const res = await uniSecCheck.textSecCheck({
- content, // 待检测的文本内容
- scene: 1, // 表示资料类场景
- version: 1 // 调用检测API的版本号
- })
-
- // 如果存在敏感词,抛出异常
- if (res.errCode === uniSecCheck.ErrorCode.RISK_CONTENT) {
- throw new Error(errorMsg || '存在敏感词,请修改后提交')
- } else if (res.errCode !== 0) {
- console.error(res)
- throw new Error('内容安全检测异常:' + res.errCode)
- }
-}
-
-// 安全检测图片内容
-async function checkImageSec(image, requestId, errorMsg) {
- // 安全引入内容安全检测模块
- const UniSecCheck = safeRequire('uni-sec-check')
- // 创建内容安全检测实例
- const uniSecCheck = new UniSecCheck({
- provider: 'mp-weixin',
- requestId
- })
-
- const images = typeof image === "string" ? [image]: image
-
- for (let item of images) {
- // 处理cloud://开头的链接
- if (item.startsWith('cloud://')) {
- const res = await uniCloud.getTempFileURL({
- fileList: [item]
- })
-
- if (res.fileList && res.fileList.length > 0) {
- item = res.fileList[0].tempFileURL
- }
- }
-
- // 调用图片安全检测接口
- const res = await uniSecCheck.imgSecCheck({
- image: item, // 待检测的图片URL
- scene: 1, // 表示资料类场景
- version: 1 // 调用检测API的版本号
- })
-
- // 如果存在违规内容,抛出异常
- if (res.errCode === uniSecCheck.ErrorCode.RISK_CONTENT) {
- throw new Error(errorMsg || '图片违规,请修改后提交')
- } else if (res.errCode !== 0) {
- console.error(res)
- throw new Error('内容安全检测异常:' + res.errCode)
- }
- }
-}
-
-// 检测内容安全开关
-function checkContentSecurityEnable(field) {
- // 1. 从配置中心获取配置
- return config.contentSecurity && config.contentSecurity.allowCheckType && config.contentSecurity.allowCheckType.includes(field)
-}
-
-// 安全require
-function safeRequire(module) {
- try {
- return require(module)
- } catch (e) {
- if (e.code === 'MODULE_NOT_FOUND') {
- throw new Error(`${module} 公共模块不存在,请在 uniCloud/database 目录右击"配置schema扩展公共模块"添加 ${module} 模块`)
- }
- }
-}
-
-module.exports = {
- trigger: {
- // 创建文章前触发
- beforeCreate: async function ({clientInfo, addDataList}) {
- // addDataList 是一个数组,因为可以一次性创建多条数据
- if (addDataList.length <= 0) return
-
- // 检测内容安全开关
- const allowCheckContent = checkContentSecurityEnable('content')
- const allowCheckImage = checkContentSecurityEnable('image')
-
- // 遍历数组,对每一条数据进行安全检测
- for (const addData of addDataList) {
- // 如果是草稿,不检测
- if (addData.article_status !== 1) continue
-
- // 并行检测
- const parallel = []
- // 检测标题
- if (allowCheckContent && addData.title) {
- parallel.push(checkContentSec(addData.title, clientInfo.requestId, '标题存在敏感字,请修改后提交'))
- }
- // 检测摘要
- if (allowCheckContent && addData.excerpt) {
- parallel.push(checkContentSec(addData.excerpt, clientInfo.requestId, '摘要存在敏感字,请修改后提交'))
- }
- // 检测内容
- if (allowCheckContent && addData.content) {
- parallel.push(checkContentSec(JSON.stringify(addData.content), clientInfo.requestId, '内容存在敏感字,请修改后提交'))
- }
- // 检测封面图
- if (allowCheckImage && addData.thumbnail) {
- parallel.push(checkImageSec(addData.thumbnail, clientInfo.requestId, '封面图存在违规,请修改后提交'))
- }
- // 等待所有并行检测完成
- await Promise.all(parallel)
- }
- },
- // 更新文章前触发
- beforeUpdate: async function ({clientInfo, where, updateData}) {
- const id = where && where._id
-
- if (!id) return
-
- // 如果是草稿,不检测
- if (updateData.article_status !== 1) return
-
- // 检测内容安全开关
- const allowCheckContent = checkContentSecurityEnable('content')
- const allowCheckImage = checkContentSecurityEnable('image')
-
- // 并行检测
- const parallel = []
-
- // 检测标题
- if (allowCheckContent && updateData.title) {
- parallel.push(checkContentSec(updateData.title, clientInfo.requestId, '标题存在敏感字,请修改后提交'))
- }
- // 检测摘要
- if (allowCheckContent && updateData.excerpt) {
- parallel.push(checkContentSec(updateData.excerpt, clientInfo.requestId, '摘要存在敏感字,请修改后提交'))
- }
- // 检测内容
- if (allowCheckContent && updateData.content) {
- parallel.push(checkContentSec(JSON.stringify(updateData.content), clientInfo.requestId, '内容存在敏感字,请修改后提交'))
- }
- // 检测封面图
- if (allowCheckImage && updateData.thumbnail) {
- parallel.push(checkImageSec(updateData.thumbnail, clientInfo.requestId, '封面图存在违规,请修改后提交'))
- }
-
- // 等待所有并行检测完成
- await Promise.all(parallel)
-
- },
- // 读取文章后触发
- afterRead: async function ({userInfo, clientInfo, result, where, field}) {
- const isAdmin = field && field.length && field.includes('is_admin')
- // 检查是否配置了clientAppIds字段,如果没有则抛出错误
- if ((!config.clientAppIds || !config.clientAppIds.length) && !isAdmin) {
- throw new Error('请在 uni-cms 配置文件中配置 clientAppIds 字段后访问,详见:https://uniapp.dcloud.net.cn/uniCloud/uni-cms.html#uni-cms-config')
- }
-
- // 如果clientAppIds字段未配置或当前appId不在clientAppIds中,则返回
- if (!config.clientAppIds || !config.clientAppIds.includes(clientInfo.appId)) return
-
- // 获取广告配置
- const adConfig = config.adConfig || {}
-
- // 获取文章id
- const id = where && where._id
-
- // 如果id不存在或者field不包含content,则返回
- if (id && field.includes('content')) {
- // 读取了content字段后view_count加1
- await db.collection(articleDBName).where(where).update({
- view_count: db.command.inc(1)
- })
- }
-
- // 如果查询结果为空,则返回
- if (!result.data || result.data.length <= 0) return
-
- // 获取文章
- const article = result.data[0]
-
- // 如果文章内容不存在,则返回
- if (!article.content) return
-
- let needUnlock = false
- let unlockContent = []
-
- // 获取文章内容中的图片
- article.content_images = article.content.ops.reduce((imageBlocks, block) => {
- if (!block.insert.image) return imageBlocks
-
- const {attributes} = block
- const {'data-custom': custom = ""} = attributes || {}
- const parseCustom = custom.split('&').reduce((obj, item) => {
- const [key, value] = item.split('=')
- obj[key] = value
- return obj
- })
-
- return imageBlocks.concat(
- parseCustom.source ||
- block.insert.image
- )
- }, [])
-
- for (const op of article.content.ops) {
- unlockContent.push(op)
- // 遍历文章内容,找到解锁内容
- if (op.insert.unlockContent) {
- needUnlock = true
- break
- }
- }
-
- // 如果文章不需要解锁,则返回
- if (!needUnlock) {
- article.content = getRenderableArticleContent(article.content, clientInfo)
- return
- }
-
- // 获取唯一标识符
- const uniqueId = adConfig.watchAdUniqueType === 'user' ? userInfo.uid : clientInfo.deviceId
-
- // 如果未登录或者文章未解锁,则返回解锁内容
- if (!uniqueId || !article._id) {
- article.content = getRenderableArticleContent({
- ops: unlockContent
- }, clientInfo)
- return
- }
-
- // 查询解锁记录
- const unlockRecord = await db.collection(unlockContentDBName).where({
- unique_id: uniqueId,
- article_id: article._id
- }).get()
-
- // 如果未解锁,则返回解锁内容
- if (unlockRecord.data && unlockRecord.data.length <= 0) {
- article.content = getRenderableArticleContent({
- ops: unlockContent
- }, clientInfo)
- return
- }
-
- // 将文章解锁替换为行结束符 \n
- article.content = getRenderableArticleContent({
- ops: article.content.ops.map(op => {
- if (op.insert.unlockContent) {
- op.insert = "\n"
- }
- return op
- })
- }, clientInfo)
- }
- }
-}
-
-function getRenderableArticleContent (rawArticleContent, clientInfo) {
- const isUniAppX = /uni-app-x/i.test(clientInfo.userAgent)
-
- if (!isUniAppX) {
- const quillDeltaConverter = new QuillDeltaToJSONConverter(rawArticleContent.ops)
- return quillDeltaConverter.convert()
- }
-
- const deltaOps = []
-
- for (let i = 0; i < rawArticleContent.ops.length; i++) {
- const op = rawArticleContent.ops[i]
-
- if (typeof op.insert === 'object') {
- const insertType = Object.keys(op.insert)
- const blockRenderList = ['image', 'divider', 'unlockContent', 'mediaVideo']
- if (insertType && insertType.length > 0 && blockRenderList.includes(insertType[0])) {
- deltaOps.push({
- type: insertType[0],
- ops: [op]
- })
-
- // 一般块级节点后面都跟一个换行,需要把这个换行给去掉
- const nextOps = rawArticleContent.ops[i + 1]
- if (nextOps && nextOps.insert === '\n') {
- i ++
- }
-
- continue
- }
- }
-
- const currentIndex = deltaOps.length > 0 ? deltaOps.length - 1: 0
- if (
- typeof deltaOps[currentIndex] !== "object" ||
- (deltaOps[currentIndex] && deltaOps[currentIndex].type !== 'rich-text')
- ) {
- deltaOps.push({
- type: 'rich-text',
- ops: []
- })
- }
-
- deltaOps[deltaOps.length - 1].ops.push(op)
- }
-
- return deltaOps.reduce((content, item) => {
- const isRichText = item.type === 'rich-text'
- let block = {
- type: item.type,
- data: isRichText ? item.ops: item.ops[0]
- }
-
- if (item.type === 'rich-text') {
- const lastOp = item.ops.length > 0 ? item.ops[item.ops.length - 1]: null
-
- if (lastOp !== null && lastOp.insert === "\n") {
- item.ops.pop()
- }
-
- const quillDeltaConverter = new QuillDeltaToHtmlConverter(item.ops)
-
- block.data = quillDeltaConverter.convert()
- }
-
- return content.concat(block)
- }, [])
-}
diff --git a/uni_modules/uni-cms-article/uniCloud/database/uni-cms-articles.schema.json b/uni_modules/uni-cms-article/uniCloud/database/uni-cms-articles.schema.json
deleted file mode 100644
index f2da220..0000000
--- a/uni_modules/uni-cms-article/uniCloud/database/uni-cms-articles.schema.json
+++ /dev/null
@@ -1,172 +0,0 @@
-{
- "bsonType": "object",
- "required": ["user_id", "title", "content"],
- "permission": {
- "read": true,
- "create": "'admin' in auth.role || 'CREATE_UNI_CMS_ARTICLE' in auth.permission",
- "update": "'admin' in auth.role || 'UPDATE_UNI_CMS_ARTICLE' in auth.permission",
- "delete": "'admin' in auth.role || 'DELETE_UNI_CMS_ARTICLE' in auth.permission"
- },
- "properties": {
- "_id": {
- "description": "存储文档 ID(用户 ID),系统自动生成"
- },
- "user_id": {
- "bsonType": "string",
- "description": "文章作者ID, 参考`uni-id-users` 表",
- "foreignKey": "uni-id-users._id",
- "defaultValue": {
- "$env": "uid"
- }
- },
- "category_id": {
- "bsonType": "string",
- "title": "分类",
- "description": "分类 id,参考`uni-news-categories`表",
- "foreignKey": "uni-cms-categories._id",
- "enum": {
- "collection": "uni-cms-categories",
- "field": "name as text, _id as value"
- }
- },
- "title": {
- "bsonType": "string",
- "title": "标题",
- "description": "标题",
- "label": "标题",
- "trim": "both"
- },
- "content": {
- "bsonType": "object",
- "title": "文章内容",
- "description": "文章内容; 格式为Quill编辑器的Delta格式",
- "label": "文章内容"
- },
- "excerpt": {
- "bsonType": "string",
- "title": "文章摘录",
- "description": "文章摘录",
- "label": "摘要",
- "trim": "both"
- },
- "article_status": {
- "bsonType": "int",
- "title": "文章状态",
- "description": "文章状态:0 草稿箱 1 已发布",
- "defaultValue": 0,
- "enum": [{
- "value": 0,
- "text": "草稿箱"
- },
- {
- "value": 1,
- "text": "已发布"
- }
- ]
- },
- "view_count": {
- "bsonType": "int",
- "title": "阅读数量",
- "description": "阅读数量",
- "defaultValue": 0,
- "permission": {
- "write": false
- }
- },
- "like_count": {
- "bsonType": "int",
- "description": "喜欢数、点赞数",
- "permission": {
- "write": false
- }
- },
- "is_sticky": {
- "bsonType": "bool",
- "title": "是否置顶",
- "description": "是否置顶",
- "permission": {
- "write": false
- }
- },
- "is_essence": {
- "bsonType": "bool",
- "title": "阅读加精",
- "description": "阅读加精",
- "permission": {
- "write": false
- }
- },
- "comment_status": {
- "bsonType": "int",
- "title": "开放评论",
- "description": "评论状态:0 关闭 1 开放",
- "enum": [{
- "value": 0,
- "text": "关闭"
- },
- {
- "value": 1,
- "text": "开放"
- }
- ]
- },
- "comment_count": {
- "bsonType": "int",
- "description": "评论数量",
- "permission": {
- "write": false
- }
- },
- "last_comment_user_id": {
- "bsonType": "string",
- "description": "最后回复用户 id,参考`uni-id-users` 表",
- "foreignKey": "uni-id-users._id"
- },
- "thumbnail": {
- "bsonType": "array",
- "title": "封面大图",
- "description": "缩略图地址",
- "label": "封面大图",
- "defaultValue": []
- },
- "publish_date": {
- "bsonType": "timestamp",
- "title": "发表时间",
- "description": "发表时间",
- "defaultValue": {
- "$env": "now"
- }
- },
- "publish_ip": {
- "bsonType": "string",
- "title": "发布文章时IP地址",
- "description": "发表时 IP 地址",
- "forceDefaultValue": {
- "$env": "clientIP"
- }
- },
- "last_modify_date": {
- "bsonType": "timestamp",
- "title": "最后修改时间",
- "description": "最后修改时间",
- "defaultValue": {
- "$env": "now"
- }
- },
- "last_modify_ip": {
- "bsonType": "string",
- "description": "最后修改时 IP 地址",
- "forceDefaultValue": {
- "$env": "clientIP"
- }
- },
- "preview_secret": {
- "bsonType": "string",
- "description": "文章预览密钥"
- },
- "preview_expired": {
- "bsonType": "timestamp",
- "description": "文章预览过期时间"
- }
- }
-}
diff --git a/uni_modules/uni-cms-article/uniCloud/database/uni-cms-unlock-record.schema.json b/uni_modules/uni-cms-article/uniCloud/database/uni-cms-unlock-record.schema.json
deleted file mode 100644
index 95e4deb..0000000
--- a/uni_modules/uni-cms-article/uniCloud/database/uni-cms-unlock-record.schema.json
+++ /dev/null
@@ -1,49 +0,0 @@
-{
- "bsonType": "object",
- "required": [
- "user_id",
- "trans_id",
- "content_id"
- ],
- "permission": {
- "read": true,
- "create": true,
- "update": false,
- "delete": false
- },
- "properties": {
- "_id": {
- "description": "存储文档 ID(用户 ID),系统自动生成"
- },
- "unique_id": {
- "bsonType": "string",
- "description": "用于标识观看广告的唯一标识"
- },
- "unique_type": {
- "bsonType": "string",
- "description": "观看广告的唯一标识类型;user 用户;device 设备"
- },
- "trans_id": {
- "bsonType": "string",
- "title": "交易ID",
- "description": "广告回调传回的交易ID",
- "label": "内容id",
- "trim": "both"
- },
- "content_id": {
- "bsonType": "string",
- "title": "内容id",
- "description": "内容(文章)ID",
- "label": "内容id",
- "trim": "both"
- },
- "create_date": {
- "bsonType": "timestamp",
- "title": "创建时间",
- "description": "创建时间",
- "defaultValue": {
- "$env": "now"
- }
- }
- }
-}
diff --git a/uni_modules/uni-config-center/changelog.md b/uni_modules/uni-config-center/changelog.md
deleted file mode 100644
index 57dbcb5..0000000
--- a/uni_modules/uni-config-center/changelog.md
+++ /dev/null
@@ -1,6 +0,0 @@
-## 0.0.3(2022-11-11)
-- 修复 config 方法获取根节点为数组格式配置时错误的转化为了对象的Bug
-## 0.0.2(2021-04-16)
-- 修改插件package信息
-## 0.0.1(2021-03-15)
-- 初始化项目
diff --git a/uni_modules/uni-config-center/package.json b/uni_modules/uni-config-center/package.json
deleted file mode 100644
index bace866..0000000
--- a/uni_modules/uni-config-center/package.json
+++ /dev/null
@@ -1,81 +0,0 @@
-{
- "id": "uni-config-center",
- "displayName": "uni-config-center",
- "version": "0.0.3",
- "description": "uniCloud 配置中心",
- "keywords": [
- "配置",
- "配置中心"
-],
- "repository": "",
- "engines": {
- "HBuilderX": "^3.1.0"
- },
-"dcloudext": {
- "sale": {
- "regular": {
- "price": "0.00"
- },
- "sourcecode": {
- "price": "0.00"
- }
- },
- "contact": {
- "qq": ""
- },
- "declaration": {
- "ads": "无",
- "data": "无",
- "permissions": "无"
- },
- "npmurl": "",
- "type": "unicloud-template-function"
- },
- "directories": {
- "example": "../../../scripts/dist"
- },
- "uni_modules": {
- "dependencies": [],
- "encrypt": [],
- "platforms": {
- "cloud": {
- "tcb": "y",
- "aliyun": "y"
- },
- "client": {
- "App": {
- "app-vue": "u",
- "app-nvue": "u"
- },
- "H5-mobile": {
- "Safari": "u",
- "Android Browser": "u",
- "微信浏览器(Android)": "u",
- "QQ浏览器(Android)": "u"
- },
- "H5-pc": {
- "Chrome": "u",
- "IE": "u",
- "Edge": "u",
- "Firefox": "u",
- "Safari": "u"
- },
- "小程序": {
- "微信": "u",
- "阿里": "u",
- "百度": "u",
- "字节跳动": "u",
- "QQ": "u"
- },
- "快应用": {
- "华为": "u",
- "联盟": "u"
- },
- "Vue": {
- "vue2": "y",
- "vue3": "u"
- }
- }
- }
- }
-}
diff --git a/uni_modules/uni-config-center/readme.md b/uni_modules/uni-config-center/readme.md
deleted file mode 100644
index 03f7fc2..0000000
--- a/uni_modules/uni-config-center/readme.md
+++ /dev/null
@@ -1,93 +0,0 @@
-# 为什么使用uni-config-center
-
-实际开发中很多插件需要配置文件才可以正常运行,如果每个插件都单独进行配置的话就会产生下面这样的目录结构
-
-```bash
-cloudfunctions
-└─────common 公共模块
- ├─plugin-a // 插件A对应的目录
- │ ├─index.js
- │ ├─config.json // plugin-a对应的配置文件
- │ └─other-file.cert // plugin-a依赖的其他文件
- └─plugin-b // plugin-b对应的目录
- ├─index.js
- └─config.json // plugin-b对应的配置文件
-```
-
-假设插件作者要发布一个项目模板,里面使用了很多需要配置的插件,无论是作者发布还是用户使用都是一个大麻烦。
-
-uni-config-center就是用了统一管理这些配置文件的,使用uni-config-center后的目录结构如下
-
-```bash
-cloudfunctions
-└─────common 公共模块
- ├─plugin-a // 插件A对应的目录
- │ └─index.js
- ├─plugin-b // plugin-b对应的目录
- │ └─index.js
- └─uni-config-center
- ├─index.js // config-center入口文件
- ├─plugin-a
- │ ├─config.json // plugin-a对应的配置文件
- │ └─other-file.cert // plugin-a依赖的其他文件
- └─plugin-b
- └─config.json // plugin-b对应的配置文件
-```
-
-使用uni-config-center后的优势
-
-- 配置文件统一管理,分离插件主体和配置信息,更新插件更方便
-- 支持对config.json设置schema,插件使用者在HBuilderX内编写config.json文件时会有更好的提示(后续HBuilderX会提供支持)
-
-# 用法
-
-在要使用uni-config-center的公共模块或云函数内引入uni-config-center依赖,请参考:[使用公共模块](https://uniapp.dcloud.net.cn/uniCloud/cf-common)
-
-```js
-const createConfig = require('uni-config-center')
-
-const uniIdConfig = createConfig({
- pluginId: 'uni-id', // 插件id
- defaultConfig: { // 默认配置
- tokenExpiresIn: 7200,
- tokenExpiresThreshold: 600,
- },
- customMerge: function(defaultConfig, userConfig) { // 自定义默认配置和用户配置的合并规则,不设置的情况侠会对默认配置和用户配置进行深度合并
- // defaudltConfig 默认配置
- // userConfig 用户配置
- return Object.assign(defaultConfig, userConfig)
- }
-})
-
-
-// 以如下配置为例
-// {
-// "tokenExpiresIn": 7200,
-// "passwordErrorLimit": 6,
-// "bindTokenToDevice": false,
-// "passwordErrorRetryTime": 3600,
-// "app-plus": {
-// "tokenExpiresIn": 2592000
-// },
-// "service": {
-// "sms": {
-// "codeExpiresIn": 300
-// }
-// }
-// }
-
-// 获取配置
-uniIdConfig.config() // 获取全部配置,注意:uni-config-center内不存在对应插件目录时会返回空对象
-uniIdConfig.config('tokenExpiresIn') // 指定键值获取配置,返回:7200
-uniIdConfig.config('service.sms.codeExpiresIn') // 指定键值获取配置,返回:300
-uniIdConfig.config('tokenExpiresThreshold', 600) // 指定键值获取配置,如果不存在则取传入的默认值,返回:600
-
-// 获取文件绝对路径
-uniIdConfig.resolve('custom-token.js') // 获取uni-config-center/uni-id/custom-token.js文件的路径
-
-// 引用文件(require)
-uniIDConfig.requireFile('custom-token.js') // 使用require方式引用uni-config-center/uni-id/custom-token.js文件。文件不存在时返回undefined,文件内有其他错误导致require失败时会抛出错误。
-
-// 判断是否包含某文件
-uniIDConfig.hasFile('custom-token.js') // 配置目录是否包含某文件,true: 文件存在,false: 文件不存在
-```
\ No newline at end of file
diff --git a/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/index.js b/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/index.js
deleted file mode 100644
index 00ba62f..0000000
--- a/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/index.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";var t=require("fs"),r=require("path");function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),o=e(r),i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var u=function(t){var r={exports:{}};return t(r,r.exports),r.exports}((function(t,r){var e="__lodash_hash_undefined__",n=9007199254740991,o="[object Arguments]",u="[object Function]",c="[object Object]",a=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s[o]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s[u]=s["[object Map]"]=s["[object Number]"]=s[c]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1;var l="object"==typeof i&&i&&i.Object===Object&&i,h="object"==typeof self&&self&&self.Object===Object&&self,p=l||h||Function("return this")(),_=r&&!r.nodeType&&r,v=_&&t&&!t.nodeType&&t,d=v&&v.exports===_,y=d&&l.process,g=function(){try{var t=v&&v.require&&v.require("util").types;return t||y&&y.binding&&y.binding("util")}catch(t){}}(),b=g&&g.isTypedArray;function j(t,r,e){switch(e.length){case 0:return t.call(r);case 1:return t.call(r,e[0]);case 2:return t.call(r,e[0],e[1]);case 3:return t.call(r,e[0],e[1],e[2])}return t.apply(r,e)}var w,O,m,A=Array.prototype,z=Function.prototype,M=Object.prototype,x=p["__core-js_shared__"],C=z.toString,F=M.hasOwnProperty,U=(w=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",S=M.toString,I=C.call(Object),P=RegExp("^"+C.call(F).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),T=d?p.Buffer:void 0,q=p.Symbol,E=p.Uint8Array,$=T?T.allocUnsafe:void 0,D=(O=Object.getPrototypeOf,m=Object,function(t){return O(m(t))}),k=Object.create,B=M.propertyIsEnumerable,N=A.splice,L=q?q.toStringTag:void 0,R=function(){try{var t=vt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),G=T?T.isBuffer:void 0,V=Math.max,W=Date.now,H=vt(p,"Map"),J=vt(Object,"create"),K=function(){function t(){}return function(r){if(!xt(r))return{};if(k)return k(r);t.prototype=r;var e=new t;return t.prototype=void 0,e}}();function Q(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r-1},X.prototype.set=function(t,r){var e=this.__data__,n=nt(e,t);return n<0?(++this.size,e.push([t,r])):e[n][1]=r,this},Y.prototype.clear=function(){this.size=0,this.__data__={hash:new Q,map:new(H||X),string:new Q}},Y.prototype.delete=function(t){var r=_t(this,t).delete(t);return this.size-=r?1:0,r},Y.prototype.get=function(t){return _t(this,t).get(t)},Y.prototype.has=function(t){return _t(this,t).has(t)},Y.prototype.set=function(t,r){var e=_t(this,t),n=e.size;return e.set(t,r),this.size+=e.size==n?0:1,this},Z.prototype.clear=function(){this.__data__=new X,this.size=0},Z.prototype.delete=function(t){var r=this.__data__,e=r.delete(t);return this.size=r.size,e},Z.prototype.get=function(t){return this.__data__.get(t)},Z.prototype.has=function(t){return this.__data__.has(t)},Z.prototype.set=function(t,r){var e=this.__data__;if(e instanceof X){var n=e.__data__;if(!H||n.length<199)return n.push([t,r]),this.size=++e.size,this;e=this.__data__=new Y(n)}return e.set(t,r),this.size=e.size,this};var it,ut=function(t,r,e){for(var n=-1,o=Object(t),i=e(t),u=i.length;u--;){var c=i[it?u:++n];if(!1===r(o[c],c,o))break}return t};function ct(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":L&&L in Object(t)?function(t){var r=F.call(t,L),e=t[L];try{t[L]=void 0;var n=!0}catch(t){}var o=S.call(t);n&&(r?t[L]=e:delete t[L]);return o}(t):function(t){return S.call(t)}(t)}function at(t){return Ct(t)&&ct(t)==o}function ft(t){return!(!xt(t)||function(t){return!!U&&U in t}(t))&&(zt(t)?P:a).test(function(t){if(null!=t){try{return C.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function st(t){if(!xt(t))return function(t){var r=[];if(null!=t)for(var e in Object(t))r.push(e);return r}(t);var r=yt(t),e=[];for(var n in t)("constructor"!=n||!r&&F.call(t,n))&&e.push(n);return e}function lt(t,r,e,n,o){t!==r&&ut(r,(function(i,u){if(o||(o=new Z),xt(i))!function(t,r,e,n,o,i,u){var a=gt(t,e),f=gt(r,e),s=u.get(f);if(s)return void rt(t,e,s);var l=i?i(a,f,e+"",t,r,u):void 0,h=void 0===l;if(h){var p=Ot(f),_=!p&&At(f),v=!p&&!_&&Ft(f);l=f,p||_||v?Ot(a)?l=a:Ct(j=a)&&mt(j)?l=function(t,r){var e=-1,n=t.length;r||(r=Array(n));for(;++e-1&&t%1==0&&t0){if(++r>=800)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}(pt);function jt(t,r){return t===r||t!=t&&r!=r}var wt=at(function(){return arguments}())?at:function(t){return Ct(t)&&F.call(t,"callee")&&!B.call(t,"callee")},Ot=Array.isArray;function mt(t){return null!=t&&Mt(t.length)&&!zt(t)}var At=G||function(){return!1};function zt(t){if(!xt(t))return!1;var r=ct(t);return r==u||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}function Mt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function xt(t){var r=typeof t;return null!=t&&("object"==r||"function"==r)}function Ct(t){return null!=t&&"object"==typeof t}var Ft=b?function(t){return function(r){return t(r)}}(b):function(t){return Ct(t)&&Mt(t.length)&&!!s[ct(t)]};function Ut(t){return mt(t)?tt(t,!0):st(t)}var St,It=(St=function(t,r,e){lt(t,r,e)},ht((function(t,r){var e=-1,n=r.length,o=n>1?r[n-1]:void 0,i=n>2?r[2]:void 0;for(o=St.length>3&&"function"==typeof o?(n--,o):void 0,i&&function(t,r,e){if(!xt(e))return!1;var n=typeof r;return!!("number"==n?mt(e)&&dt(r,e.length):"string"==n&&r in e)&&jt(e[r],t)}(r[0],r[1],i)&&(o=n<3?void 0:o,n=1),t=Object(t);++ec.call(t,r);class f{constructor({pluginId:t,defaultConfig:r={},customMerge:e,root:n}){this.pluginId=t,this.defaultConfig=r,this.pluginConfigPath=o.default.resolve(n||__dirname,t),this.customMerge=e,this._config=void 0}resolve(t){return o.default.resolve(this.pluginConfigPath,t)}hasFile(t){return n.default.existsSync(this.resolve(t))}requireFile(t){try{return require(this.resolve(t))}catch(t){if("MODULE_NOT_FOUND"===t.code)return;throw t}}_getUserConfig(){return this.requireFile("config.json")}config(t,r){if(!this._config){const t=this._getUserConfig();this._config=Array.isArray(t)?t:(this.customMerge||u)(this.defaultConfig,t)}let e=this._config;return t?function(t,r,e){if("number"==typeof r)return t[r];if("symbol"==typeof r)return a(t,r)?t[r]:e;const n="string"!=typeof(o=r)?o:o.split(".").reduce(((t,r)=>(r.split(/\[([^}]+)\]/g).forEach((r=>r&&t.push(r))),t)),[]);var o;let i=t;for(let t=0;t
-
-
- {{error.message}}
-
-
-
-
-
- 留言内容/回复内容
- {{data.content}}
-
-
- 图片列表
-
-
-
-
-
-
- 联系人
- {{data.contact}}
-
-
- 联系电话
- {{data.mobile}}
-
-
-
-
-
-
-
-
-