
/**
 * 由 Fantastic-admin 提供技术支持
 * Powered by Fantastic-admin
 * Gitee  https://gitee.com/hooray/fantastic-admin
 * Github https://github.com/hooray/fantastic-admin
 */
  
import{_ as S}from"./index-7911c6db.js";import{a as m}from"./config-b4a9e7c0.js";import{d as w,Q as K,r as f,x as P,o as q,c as A,e,f as a,a as C,k,E as _,h as o,q as h}from"./index-4eef28ae.js";const H={class:"flex justify-between"},N=C("b",null,"官方微信支付参数设置",-1),M=w({__name:"wechat",setup(j){const t=K({payWechatStatus:"",payWeChatMchId:"",payWeChatAppId:"",payWeChatSecret:"",payWeChatNotifyUrl:"",payWeChatH5Url:"",payWeChatPublicKey:"",payWeChatPrivateKey:""}),W=f({payWechatStatus:[{required:!0,trigger:"change",message:"请选择当前支付开启状态"}],payWeChatSecret:[{required:!0,trigger:"blur",message:"请填写支付Secret秘钥"}],payWeChatMchId:[{required:!0,trigger:"blur",message:"请填写商户号"}],payWeChatAppId:[{required:!0,trigger:"blur",message:"请填写AppId"}],payWeChatNotifyUrl:[{required:!0,trigger:"blur",message:"请填写支付通知地址"}],payWeChatH5Url:[{required:!0,trigger:"blur",message:"请填写H5支付通知地址"}],payWeChatPublicKey:[{required:!0,trigger:"blur",message:"请填写支付公钥信息（cert.pem文件）"}],payWeChatPrivateKey:[{required:!0,trigger:"blur",message:"请填写支付私钥地址（key.pem文件）"}]}),i=f();async function y(){const p=await m.queryConfig({keys:["payWeChatSecret","payWeChatNotifyUrl","payWeChatH5Url","payWeChatAppId","payWechatStatus","payWeChatMchId","payWeChatPublicKey","payWeChatPrivateKey"]});Object.assign(t,p.data)}function g(){var p;(p=i.value)==null||p.validate(async l=>{if(l){try{await m.setConfig({settings:b(t)}),_.success("变更配置信息成功")}catch{}y()}else _.error("请填写完整信息")})}function b(p){return Object.keys(p).map(l=>({configKey:l,configVal:p[l]}))}return P(()=>{y()}),(p,l)=>{const c=o("el-alert"),V=S,x=o("el-button"),U=o("el-switch"),u=o("el-form-item"),n=o("el-col"),d=o("el-row"),s=o("el-input"),v=o("el-form"),I=o("el-card");return q(),A("div",null,[e(V,null,{default:a(()=>[e(c,{closable:!1,"show-icon":"",title:"官方微信支付参数说明",description:"官方微信支付设置、同时开启多个支付、我们以微信支付优先级为最高、在pc端我们会调用native支付、在微信环境内、我们将调用Jsapi支付、请确认您的微信支付已经申请了支付权限、所有的支付通知地址统一为 https://域名/api/pay/notify 将域名修改为您的域名即可！",type:"warning"})]),_:1}),e(I,{style:{margin:"20px"}},{header:a(()=>[C("div",H,[N,e(x,{class:"button",text:"",onClick:g},{default:a(()=>[k(" 保存设置 ")]),_:1})])]),default:a(()=>[e(v,{ref_key:"formRef",ref:i,rules:W.value,model:t,"label-width":"140px"},{default:a(()=>[e(d,null,{default:a(()=>[e(n,{xs:24,md:20,lg:15,xl:12},{default:a(()=>[e(u,{label:"启用当前支付",prop:"payWechatStatus"},{default:a(()=>[e(U,{modelValue:t.payWechatStatus,"onUpdate:modelValue":l[0]||(l[0]=r=>t.payWechatStatus=r),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(d,null,{default:a(()=>[e(n,{xs:24,md:20,lg:15,xl:12},{default:a(()=>[e(u,{label:"商户ID",prop:"payWeChatMchId"},{default:a(()=>[e(s,{modelValue:t.payWeChatMchId,"onUpdate:modelValue":l[1]||(l[1]=r=>t.payWeChatMchId=r),placeholder:"请填写商户ID",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(d,null,{default:a(()=>[e(n,{xs:24,md:20,lg:15,xl:12},{default:a(()=>[e(u,{label:"AppId",prop:"payWeChatAppId"},{default:a(()=>[e(s,{modelValue:t.payWeChatAppId,"onUpdate:modelValue":l[2]||(l[2]=r=>t.payWeChatAppId=r),placeholder:"请填写AppId",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(d,null,{default:a(()=>[e(n,{xs:24,md:20,lg:15,xl:12},{default:a(()=>[e(u,{label:"商户秘钥",prop:"payWeChatSecret"},{default:a(()=>[e(s,{modelValue:t.payWeChatSecret,"onUpdate:modelValue":l[3]||(l[3]=r=>t.payWeChatSecret=r),placeholder:"请填写Secret秘钥",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(d,null,{default:a(()=>[e(n,{xs:24,md:20,lg:15,xl:12},{default:a(()=>[e(u,{label:"支付通知地址",prop:"payWeChatNotifyUrl"},{default:a(()=>[e(s,{modelValue:t.payWeChatNotifyUrl,"onUpdate:modelValue":l[4]||(l[4]=r=>t.payWeChatNotifyUrl=r),placeholder:"请填写支付通知地址",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(d,null,{default:a(()=>[e(n,{xs:24,md:20,lg:15,xl:12},{default:a(()=>[e(u,{label:"H5支付通知地址",prop:"payWeChatH5Url"},{default:a(()=>[e(s,{modelValue:t.payWeChatH5Url,"onUpdate:modelValue":l[5]||(l[5]=r=>t.payWeChatH5Url=r),placeholder:"请填写H5支付通知地址",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(d,null,{default:a(()=>[e(n,{xs:24,md:20,lg:15,xl:12},{default:a(()=>[e(u,{label:"公钥地址",prop:"payWeChatPublicKey"},{default:a(()=>[e(s,{modelValue:t.payWeChatPublicKey,"onUpdate:modelValue":l[6]||(l[6]=r=>t.payWeChatPublicKey=r),type:"textarea",rows:6,placeholder:"请填写支付公钥信息（cert.pem文件）",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(d,null,{default:a(()=>[e(n,{xs:24,md:20,lg:15,xl:12},{default:a(()=>[e(u,{label:"私钥地址",prop:"payWeChatPrivateKey"},{default:a(()=>[e(s,{modelValue:t.payWeChatPrivateKey,"onUpdate:modelValue":l[7]||(l[7]=r=>t.payWeChatPrivateKey=r),type:"textarea",rows:6,placeholder:"请填写支付私钥地址（key.pem文件）",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof h=="function"&&h(M);export{M as default};
