← Back
Editing: add-forbid-limit.js
import{c as e,k as a,r as s,q as l,v as t,e as m,A as r,x as d,y as i,a9 as o,a7 as u}from"./base-lib.js?v=VERSION_NUMBER";import{at as p,k as n,b as c}from"./utils-lib.js?v=VERSION_NUMBER";import{setFileDeny as f}from"./site.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";const b={class:"p-[20px]"},g=e({__name:"add-forbid-limit",props:{compData:{default:()=>({})}},emits:["close"],setup(e,{expose:g,emit:_}){const x=c(),y=e,w=_,h=a({suffix:y.compData.suffix||"php|jsp",deny_name:y.compData.name||"",dir:y.compData.dir||""}),D=s(!1),V=s(),j=a({dir:[{required:!0,message:"请输入需要禁止访问的目录",trigger:"blur"}],deny_name:[{required:!0,message:"请输入名称",trigger:"blur"}],suffix:[{required:!0,message:"请输入后缀",trigger:"blur"}]});return g({onConfirm:async e=>{await V.value.validate();try{D.value=!0;const e=await f({website:y.compData.website,...h,act:y.compData.name?"edit":"add"});e.status?(y.compData.name&&(e.msg="修改成功"),x.success(e.msg),y.compData.refresh(),w("close")):x.msg({customClass:"bt-message-error-html",dangerouslyUseHTMLString:!0,message:e.msg,type:"error",duration:0,showClose:!0})}catch(a){p(a)}finally{D.value=!1}}}),(e,a)=>{const s=n,p=o,c=u;return l(),t("div",b,[m(c,{ref_key:"forbidSiteForm",ref:V,rules:d(j),model:d(h),disabled:d(D)},{default:r((()=>[m(p,{label:"名称",prop:"deny_name"},{default:r((()=>[m(s,{modelValue:d(h).deny_name,"onUpdate:modelValue":a[0]||(a[0]=e=>d(h).deny_name=e),disabled:e.compData.name,width:"26rem"},null,8,["modelValue","disabled"])])),_:1}),m(p,{label:"后缀",prop:"suffix"},{default:r((()=>[m(s,{modelValue:d(h).suffix,"onUpdate:modelValue":a[1]||(a[1]=e=>d(h).suffix=e),width:"26rem"},null,8,["modelValue"])])),_:1}),m(p,{label:"访问路径",prop:"dir"},{default:r((()=>[m(s,{modelValue:d(h).dir,"onUpdate:modelValue":a[2]||(a[2]=e=>d(h).dir=e),placeholder:"URL中禁止访问的,如/api等",width:"26rem"},null,8,["modelValue"])])),_:1}),a[3]||(a[3]=i("ul",{class:"ml-6 mt-8 list-disc leading-10"},[i("li",{class:"text-medium"},"后缀:禁止访问的文件后缀"),i("li",{class:"text-medium"},"访问路径:如需要禁止https://www.bt.cn/api/,则填写/api即可")],-1))])),_:1},8,["rules","model","disabled"])])}}});export{g as default};
Save File
Cancel