index-0kjvOwTx.js 11 KB

1
  1. import{d as N,a2 as $,r as E,K as p,aq as M,e as b,f as K,j as n,L as m,u as i,ac as D,t,m as d,y as h,am as k,Z as H,at as T,p as B,l as F,i as O}from"./vue-A59npLRR.js";import{c as S,_ as Q}from"./index-EwE51S_X.js";import{F as s}from"./index-r6iTpmP6.js";import"./echarts-cxb9vJr1.js";import"./index-K8IR974I.js";import"./baTable-MdxYOkAk.js";import"./index-XALue448.js";function Z(){return S({url:"/admin/xmwechat.miniprogram.Config/getConfig",method:"get"})}function C(c,l){return S({url:"/admin/xmwechat.miniprogram.Config/saveConfig",method:"post",params:{type:c},data:l},{showSuccessMessage:!0})}const j=c=>(B("data-v-ce27334b"),c=c(),F(),c),z={class:"default-main"},L=j(()=>O("view",{class:"note"},"必须以http://或https://开头,分别支持80端口和443端口 ",-1)),R=N({__name:"index",setup(c){const{t:l}=$(),o=E({collapseActiveName:["miniprogram","developerInfo","messagePush","serverDomain"],miniprogram:{loading:!1,name:"",original_id:"",qr_code:""},developerInfo:{loading:!1,app_id:"",secret:""},messagePush:{loading:!1,server_url:"",server_token:"",encoding_aes_key:"",message_encryption_method:""},serverDomain:{loading:!1,request_domain:"",socket_domain:"",upload_file_domain:"",download_file_domain:"",udp_domain:"",tcp_domain:""}}),P=()=>{o.miniprogram.loading=!0,C("miniprogram",o.miniprogram).finally(()=>{o.miniprogram.loading=!1})},I=()=>{o.developerInfo.loading=!0,C("developerInfo",o.developerInfo).finally(()=>{o.developerInfo.loading=!1})},U=()=>{o.messagePush.loading=!0,C("messagePush",o.messagePush).finally(()=>{o.messagePush.loading=!1})},A=()=>{Z().then(_=>{let e=_.data.miniprogram;o.miniprogram.name=e.name,o.miniprogram.original_id=e.original_id,o.miniprogram.qr_code=e.qr_code,o.developerInfo.app_id=e.app_id,o.developerInfo.secret=e.secret,o.messagePush.server_url=e.server_url,o.messagePush.server_token=e.server_token,o.messagePush.encoding_aes_key=e.encoding_aes_key,o.messagePush.message_encryption_method=e.message_encryption_method,o.serverDomain.request_domain=e.request_domain,o.serverDomain.socket_domain=e.socket_domain,o.serverDomain.upload_file_domain=e.upload_file_domain,o.serverDomain.download_file_domain=e.download_file_domain,o.serverDomain.udp_domain=e.udp_domain,o.serverDomain.tcp_domain=e.tcp_domain}).catch(_=>{H({type:"error",message:_})})},u=_=>{let e=document.createElement("input");e.value=_,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.execCommand("copy")&&T({type:"success",message:"复制成功!"}),document.body.removeChild(e)};return A(),(_,e)=>{const r=p("el-button"),v=p("el-form"),y=p("el-collapse-item"),V=p("el-collapse"),w=p("el-col"),g=p("el-input"),f=p("el-form-item"),q=p("el-row"),x=M("blur");return b(),K("div",z,[n(q,{gutter:24},{default:m(()=>[n(w,{span:12},{default:m(()=>[n(V,{class:"collapse",modelValue:o.collapseActiveName,"onUpdate:modelValue":e[5]||(e[5]=a=>o.collapseActiveName=a)},{default:m(()=>[n(y,{class:"collapse-item",title:i(l)("xmwechat.miniprogram.config.Miniprogram"),name:"miniprogram"},{default:m(()=>[n(v,{onKeyup:e[4]||(e[4]=D(a=>P(),["enter"])),model:o.miniprogram,"label-position":"top","label-width":200},{default:m(()=>[n(s,{label:i(l)("xmwechat.miniprogram.config.Name"),type:"string",modelValue:o.miniprogram.name,"onUpdate:modelValue":e[0]||(e[0]=a=>o.miniprogram.name=a),prop:"name",placeholder:i(l)("Please input field",{field:i(l)("xmwechat.miniprogram.config.Name")})},null,8,["label","modelValue","placeholder"]),n(s,{label:i(l)("xmwechat.miniprogram.config.OriginalId"),type:"string",modelValue:o.miniprogram.original_id,"onUpdate:modelValue":e[1]||(e[1]=a=>o.miniprogram.original_id=a),prop:"original_id",attr:{blockHelp:"小程序账号登录微信公众平台,设置>账号信息,原始ID"},placeholder:i(l)("Please input field",{field:i(l)("xmwechat.miniprogram.config.OriginalId")})},null,8,["label","modelValue","placeholder"]),n(s,{label:i(l)("xmwechat.miniprogram.config.QrCode"),type:"image",modelValue:o.miniprogram.qr_code,"onUpdate:modelValue":e[2]||(e[2]=a=>o.miniprogram.qr_code=a),prop:"qr_code",placeholder:i(l)("Please input field",{field:i(l)("xmwechat.miniprogram.config.QrCode")})},null,8,["label","modelValue","placeholder"]),k((b(),h(r,{loading:o.miniprogram.loading,onClick:e[3]||(e[3]=a=>P()),type:"primary"},{default:m(()=>[d(t(i(l)("Save")),1)]),_:1},8,["loading"])),[[x]])]),_:1},8,["model"])]),_:1},8,["title"])]),_:1},8,["modelValue"])]),_:1}),n(w,{span:12},{default:m(()=>[n(V,{class:"collapse",modelValue:o.collapseActiveName,"onUpdate:modelValue":e[13]||(e[13]=a=>o.collapseActiveName=a)},{default:m(()=>[n(y,{class:"collapse-item",title:i(l)("xmwechat.miniprogram.config.MessagePush"),name:"messagePush"},{default:m(()=>[n(v,{onKeyup:e[12]||(e[12]=D(a=>U(),["enter"])),model:o.messagePush,"label-position":"top","label-width":200},{default:m(()=>[n(f,{label:i(l)("xmwechat.miniprogram.config.ServerUrl")},{default:m(()=>[n(g,{type:"string",modelValue:o.messagePush.server_url,"onUpdate:modelValue":e[7]||(e[7]=a=>o.messagePush.server_url=a),prop:"server_url",readonly:""},{append:m(()=>[n(r,{onClick:e[6]||(e[6]=a=>u(o.messagePush.server_url))},{default:m(()=>[d(t(i(l)("xmwechat.miniprogram.config.Copy")),1)]),_:1})]),_:1},8,["modelValue"]),L]),_:1},8,["label"]),n(s,{label:i(l)("xmwechat.miniprogram.config.ServerToken"),type:"string",modelValue:o.messagePush.server_token,"onUpdate:modelValue":e[8]||(e[8]=a=>o.messagePush.server_token=a),prop:"server_token",attr:{blockHelp:"Token必须为英文或数字,长度为3-32字符。"},placeholder:i(l)("Please input field",{field:i(l)("xmwechat.miniprogram.config.ServerToken")})},null,8,["label","modelValue","placeholder"]),n(s,{label:i(l)("xmwechat.miniprogram.config.EncodingAESKey"),type:"string",modelValue:o.messagePush.encoding_aes_key,"onUpdate:modelValue":e[9]||(e[9]=a=>o.messagePush.encoding_aes_key=a),prop:"encoding_aes_key",attr:{blockHelp:"消息加密密钥由43位字符组成,可随机修改,字符范围为A-Z,a-z,0-9。"},placeholder:i(l)("Please input field",{field:i(l)("xmwechat.miniprogram.config.EncodingAESKey")})},null,8,["label","modelValue","placeholder"]),n(s,{label:i(l)("xmwechat.miniprogram.config.MessageEncryptionMethod"),type:"radio",modelValue:o.messagePush.message_encryption_method,"onUpdate:modelValue":e[10]||(e[10]=a=>o.messagePush.message_encryption_method=a),prop:"message_encryption_method",data:{content:{plaintext:i(l)("xmwechat.miniprogram.config.Plaintext")},childrenAttr:{border:!0}},placeholder:i(l)("Please input field",{field:i(l)("xmwechat.miniprogram.config.MessageEncryptionMethod")})},null,8,["label","modelValue","data","placeholder"]),k((b(),h(r,{loading:o.messagePush.loading,onClick:e[11]||(e[11]=a=>U()),type:"primary"},{default:m(()=>[d(t(i(l)("Save")),1)]),_:1},8,["loading"])),[[x]])]),_:1},8,["model"])]),_:1},8,["title"])]),_:1},8,["modelValue"])]),_:1}),n(w,{span:12},{default:m(()=>[n(V,{class:"collapse",modelValue:o.collapseActiveName,"onUpdate:modelValue":e[18]||(e[18]=a=>o.collapseActiveName=a)},{default:m(()=>[n(y,{class:"collapse-item",title:i(l)("xmwechat.miniprogram.config.DeveloperInfo"),name:"developerInfo"},{default:m(()=>[n(v,{onKeyup:e[17]||(e[17]=D(a=>I(),["enter"])),model:o.developerInfo,"label-position":"top","label-width":200},{default:m(()=>[n(s,{label:i(l)("xmwechat.miniprogram.config.AppId"),type:"string",modelValue:o.developerInfo.app_id,"onUpdate:modelValue":e[14]||(e[14]=a=>o.developerInfo.app_id=a),prop:"app_id",attr:{blockHelp:"小程序账号登录微信公众平台,点击开发>开发设置->开发者ID,获取AppID"},placeholder:i(l)("Please input field",{field:i(l)("xmwechat.miniprogram.config.AppId")})},null,8,["label","modelValue","placeholder"]),n(s,{label:i(l)("xmwechat.miniprogram.config.AppSecret"),type:"string",modelValue:o.developerInfo.secret,"onUpdate:modelValue":e[15]||(e[15]=a=>o.developerInfo.secret=a),prop:"secret",attr:{blockHelp:"小程序账号登录微信公众平台,点击开发>开发设置->开发者ID,获取AppSecret"},placeholder:i(l)("Please input field",{field:i(l)("xmwechat.miniprogram.config.AppSecret")})},null,8,["label","modelValue","placeholder"]),k((b(),h(r,{loading:o.developerInfo.loading,onClick:e[16]||(e[16]=a=>I()),type:"primary"},{default:m(()=>[d(t(i(l)("Save")),1)]),_:1},8,["loading"])),[[x]])]),_:1},8,["model"])]),_:1},8,["title"])]),_:1},8,["modelValue"])]),_:1}),n(w,{span:12},{default:m(()=>[n(V,{class:"collapse",modelValue:o.collapseActiveName,"onUpdate:modelValue":e[31]||(e[31]=a=>o.collapseActiveName=a)},{default:m(()=>[n(y,{class:"collapse-item",title:i(l)("xmwechat.miniprogram.config.ServerDomain"),name:"serverDomain"},{default:m(()=>[n(v,{model:o.serverDomain,"label-position":"top","label-width":200},{default:m(()=>[n(f,{label:i(l)("xmwechat.miniprogram.config.RequestDomain")},{default:m(()=>[n(g,{type:"string",modelValue:o.serverDomain.request_domain,"onUpdate:modelValue":e[20]||(e[20]=a=>o.serverDomain.request_domain=a),prop:"request_domain",readonly:""},{append:m(()=>[n(r,{onClick:e[19]||(e[19]=a=>u(o.serverDomain.request_domain))},{default:m(()=>[d(t(i(l)("xmwechat.miniprogram.config.Copy")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"]),n(f,{label:i(l)("xmwechat.miniprogram.config.SocketDomain")},{default:m(()=>[n(g,{type:"string",modelValue:o.serverDomain.socket_domain,"onUpdate:modelValue":e[22]||(e[22]=a=>o.serverDomain.socket_domain=a),prop:"socket_domain",readonly:""},{append:m(()=>[n(r,{onClick:e[21]||(e[21]=a=>u(o.serverDomain.socket_domain))},{default:m(()=>[d(t(i(l)("xmwechat.miniprogram.config.Copy")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"]),n(f,{label:i(l)("xmwechat.miniprogram.config.UploadFileDomain")},{default:m(()=>[n(g,{type:"string",modelValue:o.serverDomain.upload_file_domain,"onUpdate:modelValue":e[24]||(e[24]=a=>o.serverDomain.upload_file_domain=a),prop:"upload_file_domain",readonly:""},{append:m(()=>[n(r,{onClick:e[23]||(e[23]=a=>u(o.serverDomain.upload_file_domain))},{default:m(()=>[d(t(i(l)("xmwechat.miniprogram.config.Copy")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"]),n(f,{label:i(l)("xmwechat.miniprogram.config.DownloadFileDomain")},{default:m(()=>[n(g,{type:"string",modelValue:o.serverDomain.download_file_domain,"onUpdate:modelValue":e[26]||(e[26]=a=>o.serverDomain.download_file_domain=a),prop:"download_file_domain",readonly:""},{append:m(()=>[n(r,{onClick:e[25]||(e[25]=a=>u(o.serverDomain.download_file_domain))},{default:m(()=>[d(t(i(l)("xmwechat.miniprogram.config.Copy")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"]),n(f,{label:i(l)("xmwechat.miniprogram.config.UdpDomain")},{default:m(()=>[n(g,{type:"string",modelValue:o.serverDomain.udp_domain,"onUpdate:modelValue":e[28]||(e[28]=a=>o.serverDomain.udp_domain=a),prop:"udp_domain",readonly:""},{append:m(()=>[n(r,{onClick:e[27]||(e[27]=a=>u(o.serverDomain.udp_domain))},{default:m(()=>[d(t(i(l)("xmwechat.miniprogram.config.Copy")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"]),n(f,{label:i(l)("xmwechat.miniprogram.config.TcpDomain")},{default:m(()=>[n(g,{type:"string",modelValue:o.serverDomain.tcp_domain,"onUpdate:modelValue":e[30]||(e[30]=a=>o.serverDomain.tcp_domain=a),prop:"tcp_domain",readonly:""},{append:m(()=>[n(r,{onClick:e[29]||(e[29]=a=>u(o.serverDomain.tcp_domain))},{default:m(()=>[d(t(i(l)("xmwechat.miniprogram.config.Copy")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["title"])]),_:1},8,["modelValue"])]),_:1})]),_:1})])}}}),ae=Q(R,[["__scopeId","data-v-ce27334b"]]);export{ae as default};