
/**
 * 由 Fantastic-admin 提供技术支持
 * Powered by Fantastic-admin
 * https://fantastic-admin.github.io
 */

import{_ as I}from"./index.vue_vue_type_script_setup_true_lang-BTce45WY.js";import{d as M,m as k,r as _,a as C,p as r,g as N,c as q,b as e,w as t,h as L,e as d,G as y,j as R,_ as B,k as g}from"./index-nGFMSQGw.js";import{a as z}from"./config-CYXO1pNF.js";const j=d("div",{class:"flex items-center gap-4"},"蓝兔支付设置",-1),$=d("div",{class:"text-sm/6"},[d("div",null,[d("a",{href:"https://www.ltzf.cn/",target:"_blank"},"蓝兔支付"),L(" 为第三方支付，接入请购买微信渠道。 ")]),d("div",null,"支付通知地址为： https://您的域名/api/pay/notify。")],-1),E=M({__name:"ltzf",setup(H){const a=k({payLtzfStatus:"",payLtzfMchId:"",payLtzfSecret:"",payLtzfNotifyUrl:"",payLtzfReturnUrl:""}),x=_({payLtzfStatus:[{required:!0,trigger:"change",message:"请选择当前支付开启状态"}],payLtzfSecret:[{required:!0,trigger:"blur",message:"请填写商户秘钥"}],payLtzfMchId:[{required:!0,trigger:"blur",message:"请填写商户号"}],payLtzfNotifyUrl:[{required:!0,trigger:"blur",message:"请填写支付通知地址"}]}),c=_();async function i(){const n=await z.queryConfig({keys:["payLtzfSecret","payLtzfNotifyUrl","payLtzfReturnUrl","payLtzfMchId","payLtzfStatus"]});Object.assign(a,n.data)}function V(){var n;(n=c.value)==null||n.validate(async l=>{if(l){try{await z.setConfig({settings:b(a)}),y.success("变更配置信息成功")}catch{}i()}else y.error("请填写完整信息")})}function b(n){return Object.keys(n).map(l=>({configKey:l,configVal:n[l]}))}return C(()=>{i()}),(n,l)=>{const m=R,h=B,v=I,S=r("el-switch"),f=r("el-form-item"),u=r("el-col"),s=r("el-row"),p=r("el-input"),U=r("el-form"),w=r("el-card");return N(),q("div",null,[e(v,null,{title:t(()=>[j]),content:t(()=>[$]),default:t(()=>[e(h,{outline:"",onClick:V},{default:t(()=>[e(m,{name:"i-ri:file-text-line"}),L(" 保存设置 ")]),_:1})]),_:1}),e(w,{style:{margin:"20px"}},{default:t(()=>[e(U,{ref_key:"formRef",ref:c,rules:x.value,model:a,"label-width":"120px"},{default:t(()=>[e(s,null,{default:t(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(f,{label:"启用当前支付",prop:"payLtzfMchId"},{default:t(()=>[e(S,{modelValue:a.payLtzfStatus,"onUpdate:modelValue":l[0]||(l[0]=o=>a.payLtzfStatus=o),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(s,null,{default:t(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(f,{label:"商户号",prop:"payLtzfMchId"},{default:t(()=>[e(p,{modelValue:a.payLtzfMchId,"onUpdate:modelValue":l[1]||(l[1]=o=>a.payLtzfMchId=o),placeholder:"请填写商户号",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(s,null,{default:t(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(f,{label:"商户密钥",prop:"payLtzfSecret"},{default:t(()=>[e(p,{modelValue:a.payLtzfSecret,"onUpdate:modelValue":l[2]||(l[2]=o=>a.payLtzfSecret=o),placeholder:"请填写商户秘钥",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(s,null,{default:t(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(f,{label:"支付通知地址",prop:"payLtzfSecret"},{default:t(()=>[e(p,{modelValue:a.payLtzfNotifyUrl,"onUpdate:modelValue":l[3]||(l[3]=o=>a.payLtzfNotifyUrl=o),placeholder:"请填写支付通知地址",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(s,null,{default:t(()=>[e(u,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(f,{label:"支付回调地址",prop:"payLtzfSecret"},{default:t(()=>[e(p,{modelValue:a.payLtzfReturnUrl,"onUpdate:modelValue":l[4]||(l[4]=o=>a.payLtzfReturnUrl=o),placeholder:"请填写支付成功后的回跳地址",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof g=="function"&&g(E);export{E as default};
