import{g as S,e as C}from"./config-6561e667.js";import{M as c,I as w,F as U,d as v,L as x,B,S as F,e as R,b as E}from"./ui-ba7aaa7e.js";import{e as I,l as L,r as M,P as d,a3 as m,a4 as o,f as t,a9 as u,H as s}from"./vue-bf422dc1.js";const N={name:"WebDomain"},Y=I({...N,setup(j){const e=L({site_domain:"",site_shop_domain:"",site_domain_short:"",suo_app_key:"",site_shortlink_domain:"",suolink_app_key:"",suolink_app_domain:""});(async()=>{const{data:i}=await S({field:Object.keys(e)});for(const a in i)e[a]=i[a]})();const k={site_domain:[{required:!0,message:"请输入主站域名"}]},p=M(),b=async()=>{const i=await p.value.validate();if(typeof i!="object"&&i){const a=await C({data:e});a.code===1?c.success("操作成功"):c.error(a.msg)}};return(i,a)=>{const _=w,n=U,y=v,r=x,f=B,V=F,h=R,g=E;return d(),m(g,{style:{"padding-top":"20px"},class:"basic-container",bordered:!1},{default:o(()=>[t(h,{ref_key:"formRef",ref:p,"label-align":"left",data:e,rules:k,"label-width":150,style:{width:"500px"}},{default:o(()=>[t(n,{label:"网站域名",name:"site_domain",tips:""},{default:o(()=>[t(_,{modelValue:e.site_domain,"onUpdate:modelValue":a[0]||(a[0]=l=>e.site_domain=l),clearable:"",placeholder:"请输入网站域名",tips:"用于资源链接和支付回调的地址生成补全"},null,8,["modelValue"])]),_:1}),t(n,{label:"链接域名",name:"site_shop_domain",tips:"短链接将会通过此处填写的域名生成对应的短链接。"},{default:o(()=>[t(_,{modelValue:e.site_shop_domain,"onUpdate:modelValue":a[1]||(a[1]=l=>e.site_shop_domain=l),clearable:"",placeholder:"请输入链接域名"},null,8,["modelValue"])]),_:1}),t(n,{label:"短网址功能",name:"site_domain_short"},{default:o(()=>[t(y,{modelValue:e.site_domain_short,"onUpdate:modelValue":a[2]||(a[2]=l=>e.site_domain_short=l),options:[{label:"缩我短网址",value:"Suo"},{label:"缩链短网址",value:"Suolink"}],clearable:"",placeholder:"请选择短网址功能"},null,8,["modelValue"])]),_:1}),e.site_domain_short=="Site"?(d(),m(n,{key:0,label:"短网址域名",name:"sina_app_key"},{default:o(()=>[t(_,{modelValue:e.site_shortlink_domain,"onUpdate:modelValue":a[3]||(a[3]=l=>e.site_shortlink_domain=l),clearable:"",placeholder:"请输入短网址域名"},null,8,["modelValue"])]),_:1})):u("",!0),e.site_domain_short=="Suo"?(d(),m(n,{key:1,label:"缩我短网址配置（KEY）",name:"suo_app_key"},{tips:o(()=>[s(" 缩我短网址申请网址："),t(r,{href:"https://suowo.cn/",target:"_blank"},{default:o(()=>[s("https://suowo.cn/ ")]),_:1})]),default:o(()=>[t(_,{modelValue:e.suo_app_key,"onUpdate:modelValue":a[4]||(a[4]=l=>e.suo_app_key=l),clearable:"",placeholder:"请输入缩我key"},null,8,["modelValue"])]),_:1})):u("",!0),e.site_domain_short=="Suolink"?(d(),m(n,{key:2,label:"缩链短网址配置（KEY）",name:"suolink_app_key"},{tips:o(()=>[s(" 缩链短网址申请网址："),t(r,{href:"https://suolink.cn/",target:"_blank"},{default:o(()=>[s("https://suolink.cn/ ")]),_:1})]),default:o(()=>[t(_,{modelValue:e.suolink_app_key,"onUpdate:modelValue":a[5]||(a[5]=l=>e.suolink_app_key=l),clearable:"",placeholder:"请输入缩我key"},null,8,["modelValue"])]),_:1})):u("",!0),e.site_domain_short=="Suolink"?(d(),m(n,{key:3,label:"缩链短网址配置（域名）",name:"suolink_app_domain"},{tips:o(()=>[s(" 用于缩链短网址的独立域名 ")]),default:o(()=>[t(_,{modelValue:e.suolink_app_domain,"onUpdate:modelValue":a[6]||(a[6]=l=>e.suolink_app_domain=l),clearable:"",placeholder:"请输入缩链短网址域名"},null,8,["modelValue"])]),_:1})):u("",!0),t(n,null,{default:o(()=>[t(V,{size:"small"},{default:o(()=>[t(f,{theme:"primary",onClick:b},{default:o(()=>[s("提交")]),_:1}),t(f,{theme:"default",variant:"base",type:"reset"},{default:o(()=>[s("重置")]),_:1})]),_:1})]),_:1})]),_:1},8,["data"])]),_:1})}}});export{Y as _};
