index-tihlU4Gc.js 11 KB

1
  1. import{d as j,a2 as O,r as q,K as d,aq as K,e as V,f as H,j as n,L as i,u as t,ac as I,t as s,m as c,y as C,am as S,Z as M,at as B,p as T,l as F,i as x}from"./vue-A59npLRR.js";import{c as E,_ as R}from"./index-EwE51S_X.js";import{F as r}from"./index-r6iTpmP6.js";import"./echarts-cxb9vJr1.js";import"./index-K8IR974I.js";import"./baTable-MdxYOkAk.js";import"./index-XALue448.js";function J(){return E({url:"/admin/xmwechat.offiaccount.Config/getConfig",method:"get"})}function A(u,l){return E({url:"/admin/xmwechat.offiaccount.Config/saveConfig",method:"post",params:{type:u},data:l},{showSuccessMessage:!0})}const h=u=>(T("data-v-751f5b7c"),u=u(),F(),u),L={class:"default-main"},Q=h(()=>x("view",{class:"note"},"登录微信公众平台,点击开发>基本配置>服务器配置,填写服务器地址(URL)",-1)),Z=h(()=>x("view",{class:"note"},"登录微信公众平台,点击设置>公众号设置>功能设置,填写业务域名",-1)),z=h(()=>x("view",{class:"note"},"登录微信公众平台,点击设置>公众号设置>功能设置,填写JS接口安全域名",-1)),W=h(()=>x("view",{class:"note"},"登录微信公众平台,点击设置>公众号设置>功能设置,填写网页授权域名",-1)),G=j({__name:"index",setup(u){const{t:l}=O(),o=q({collapseActiveName:["offiaccount","developerInfo","server","feature"],offiaccount:{loading:!1,offi_name:"",original_id:"",offi_qr_code:""},developerInfo:{loading:!1,app_id:"",secret:"",redirect_url:""},server:{loading:!1,server_url:"",server_token:"",encoding_aes_key:"",message_encryption_method:""},feature:{loading:!1,business_domain:"",js_security_domain:"",website_auth_domain:""}}),U=()=>{o.offiaccount.loading=!0,A("offiaccount",o.offiaccount).finally(()=>{o.offiaccount.loading=!1})},N=()=>{o.developerInfo.loading=!0,A("developerInfo",o.developerInfo).finally(()=>{o.developerInfo.loading=!1})},D=()=>{o.server.loading=!0,A("server",o.server).finally(()=>{o.server.loading=!1})},P=()=>{J().then(p=>{let e=p.data.offiaccount;o.offiaccount.offi_name=e.offi_name,o.offiaccount.original_id=e.original_id,o.offiaccount.offi_qr_code=e.offi_qr_code,o.developerInfo.app_id=e.app_id,o.developerInfo.secret=e.secret,o.developerInfo.redirect_url=e.redirect_url,o.server.server_url=e.server_url,o.server.server_token=e.server_token,o.server.encoding_aes_key=e.encoding_aes_key,o.server.message_encryption_method=e.message_encryption_method,o.feature.business_domain=e.business_domain,o.feature.js_security_domain=e.js_security_domain,o.feature.website_auth_domain=e.website_auth_domain}).catch(p=>{M({type:"error",message:p})})},m=p=>{let e=document.createElement("input");e.value=p,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.execCommand("copy")&&B({type:"success",message:"复制成功!"}),document.body.removeChild(e)};return P(),(p,e)=>{const f=d("el-button"),_=d("el-form"),g=d("el-collapse-item"),v=d("el-collapse"),y=d("el-col"),b=d("el-input"),w=d("el-form-item"),$=d("el-row"),k=K("blur");return V(),H("div",L,[n($,{gutter:24},{default:i(()=>[n(y,{span:12},{default:i(()=>[n(v,{class:"collapse",modelValue:o.collapseActiveName,"onUpdate:modelValue":e[5]||(e[5]=a=>o.collapseActiveName=a)},{default:i(()=>[n(g,{class:"collapse-item",title:t(l)("xmwechat.offiaccount.config.Offiaccount"),name:"offiaccount"},{default:i(()=>[n(_,{onKeyup:e[4]||(e[4]=I(a=>U(),["enter"])),model:o.offiaccount,"label-position":"top","label-width":200},{default:i(()=>[n(r,{label:t(l)("xmwechat.offiaccount.config.OffiName"),type:"string",modelValue:o.offiaccount.offi_name,"onUpdate:modelValue":e[0]||(e[0]=a=>o.offiaccount.offi_name=a),prop:"offi_name",placeholder:t(l)("Please input field",{field:t(l)("xmwechat.offiaccount.config.OffiName")})},null,8,["label","modelValue","placeholder"]),n(r,{label:t(l)("xmwechat.offiaccount.config.OriginalId"),type:"string",modelValue:o.offiaccount.original_id,"onUpdate:modelValue":e[1]||(e[1]=a=>o.offiaccount.original_id=a),prop:"original_id",attr:{blockHelp:"登录微信公众平台,账号详情>注册信息,原始ID"},placeholder:t(l)("Please input field",{field:t(l)("xmwechat.offiaccount.config.OriginalId")})},null,8,["label","modelValue","placeholder"]),n(r,{label:t(l)("xmwechat.offiaccount.config.OffiQrCode"),type:"image",modelValue:o.offiaccount.offi_qr_code,"onUpdate:modelValue":e[2]||(e[2]=a=>o.offiaccount.offi_qr_code=a),prop:"offi_qr_code",placeholder:t(l)("Please input field",{field:t(l)("xmwechat.offiaccount.config.OffiQrCode")})},null,8,["label","modelValue","placeholder"]),S((V(),C(f,{loading:o.offiaccount.loading,onClick:e[3]||(e[3]=a=>U()),type:"primary"},{default:i(()=>[c(s(t(l)("Save")),1)]),_:1},8,["loading"])),[[k]])]),_:1},8,["model"])]),_:1},8,["title"])]),_:1},8,["modelValue"])]),_:1}),n(y,{span:12},{default:i(()=>[n(v,{class:"collapse",modelValue:o.collapseActiveName,"onUpdate:modelValue":e[13]||(e[13]=a=>o.collapseActiveName=a)},{default:i(()=>[n(g,{class:"collapse-item",title:t(l)("xmwechat.offiaccount.config.Server"),name:"server"},{default:i(()=>[n(_,{onKeyup:e[12]||(e[12]=I(a=>D(),["enter"])),model:o.server,"label-position":"top","label-width":200},{default:i(()=>[n(w,{label:t(l)("xmwechat.offiaccount.config.ServerUrl")},{default:i(()=>[n(b,{type:"string",modelValue:o.server.server_url,"onUpdate:modelValue":e[7]||(e[7]=a=>o.server.server_url=a),prop:"server_url",readonly:""},{append:i(()=>[n(f,{onClick:e[6]||(e[6]=a=>m(o.server.server_url))},{default:i(()=>[c(s(t(l)("xmwechat.offiaccount.config.Copy")),1)]),_:1})]),_:1},8,["modelValue"]),Q]),_:1},8,["label"]),n(r,{label:t(l)("xmwechat.offiaccount.config.ServerToken"),type:"string",modelValue:o.server.server_token,"onUpdate:modelValue":e[8]||(e[8]=a=>o.server.server_token=a),prop:"server_token",attr:{blockHelp:"登录微信公众平台,点击开发>基本配置>服务器配置,设置令牌Token。必须为英文或数字,长度为3-32字符。"},placeholder:t(l)("Please input field",{field:t(l)("xmwechat.offiaccount.config.ServerToken")})},null,8,["label","modelValue","placeholder"]),n(r,{label:t(l)("xmwechat.offiaccount.config.EncodingAESKey"),type:"string",modelValue:o.server.encoding_aes_key,"onUpdate:modelValue":e[9]||(e[9]=a=>o.server.encoding_aes_key=a),prop:"encoding_aes_key",attr:{blockHelp:"(加密方式为明文模式,请勿配置加解密密钥,此处留空)消息加密密钥由43位字符组成,可随机修改,字符范围为A-Z,a-z,0-9。"},placeholder:t(l)("Please input field",{field:t(l)("xmwechat.offiaccount.config.EncodingAESKey")})},null,8,["label","modelValue","placeholder"]),n(r,{label:t(l)("xmwechat.offiaccount.config.MessageEncryptionMethod"),type:"radio",modelValue:o.server.message_encryption_method,"onUpdate:modelValue":e[10]||(e[10]=a=>o.server.message_encryption_method=a),prop:"message_encryption_method",data:{content:{plaintext:t(l)("xmwechat.offiaccount.config.Plaintext"),security:t(l)("xmwechat.offiaccount.config.Security")},childrenAttr:{border:!0}},placeholder:t(l)("Please input field",{field:t(l)("xmwechat.offiaccount.config.MessageEncryptionMethod")})},null,8,["label","modelValue","data","placeholder"]),S((V(),C(f,{loading:o.offiaccount.loading,onClick:e[11]||(e[11]=a=>D()),type:"primary"},{default:i(()=>[c(s(t(l)("Save")),1)]),_:1},8,["loading"])),[[k]])]),_:1},8,["model"])]),_:1},8,["title"])]),_:1},8,["modelValue"])]),_:1}),n(y,{span:12},{default:i(()=>[n(v,{class:"collapse",modelValue:o.collapseActiveName,"onUpdate:modelValue":e[19]||(e[19]=a=>o.collapseActiveName=a)},{default:i(()=>[n(g,{class:"collapse-item",title:t(l)("xmwechat.offiaccount.config.DeveloperInfo"),name:"developerInfo"},{default:i(()=>[n(_,{onKeyup:e[18]||(e[18]=I(a=>N(),["enter"])),model:o.developerInfo,"label-position":"top","label-width":200},{default:i(()=>[n(r,{label:t(l)("xmwechat.offiaccount.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:t(l)("Please input field",{field:t(l)("xmwechat.offiaccount.config.AppId")})},null,8,["label","modelValue","attr","placeholder"]),n(r,{label:t(l)("xmwechat.offiaccount.config.AppSecret"),type:"string",modelValue:o.developerInfo.secret,"onUpdate:modelValue":e[15]||(e[15]=a=>o.developerInfo.secret=a),prop:"secret",attr:{blockHelp:"登录微信公众平台,点击开发>基本配置>公众号开发信息,获取开发者密码(AppSecret)"},placeholder:t(l)("Please input field",{field:t(l)("xmwechat.offiaccount.config.AppSecret")})},null,8,["label","modelValue","placeholder"]),n(r,{label:t(l)("xmwechat.offiaccount.config.RedirectUrl"),type:"string",modelValue:o.developerInfo.redirect_url,"onUpdate:modelValue":e[16]||(e[16]=a=>o.developerInfo.redirect_url=a),prop:"redirect_url",attr:{blockHelp:"请前往公众号【设置与开发】【公众号设置】【功能设置】设置网页授权域名"},placeholder:t(l)("Please input field",{field:t(l)("xmwechat.offiaccount.config.RedirectUrl")})},null,8,["label","modelValue","placeholder"]),S((V(),C(f,{loading:o.offiaccount.loading,onClick:e[17]||(e[17]=a=>N()),type:"primary"},{default:i(()=>[c(s(t(l)("Save")),1)]),_:1},8,["loading"])),[[k]])]),_:1},8,["model"])]),_:1},8,["title"])]),_:1},8,["modelValue"])]),_:1}),n(y,{span:12},{default:i(()=>[n(v,{class:"collapse",modelValue:o.collapseActiveName,"onUpdate:modelValue":e[26]||(e[26]=a=>o.collapseActiveName=a)},{default:i(()=>[n(g,{class:"collapse-item",title:t(l)("xmwechat.offiaccount.config.Feature"),name:"feature"},{default:i(()=>[n(_,{model:o.feature,"label-position":"top","label-width":200},{default:i(()=>[n(w,{label:t(l)("xmwechat.offiaccount.config.BusinessDomain")},{default:i(()=>[n(b,{type:"string",modelValue:o.feature.business_domain,"onUpdate:modelValue":e[21]||(e[21]=a=>o.feature.business_domain=a),prop:"business_domain",readonly:""},{append:i(()=>[n(f,{onClick:e[20]||(e[20]=a=>m(o.feature.business_domain))},{default:i(()=>[c(s(t(l)("xmwechat.offiaccount.config.Copy")),1)]),_:1})]),_:1},8,["modelValue"]),Z]),_:1},8,["label"]),n(w,{label:t(l)("xmwechat.offiaccount.config.JsSecurityDomain")},{default:i(()=>[n(b,{type:"string",modelValue:o.feature.js_security_domain,"onUpdate:modelValue":e[23]||(e[23]=a=>o.feature.js_security_domain=a),prop:"js_security_domain",readonly:""},{append:i(()=>[n(f,{onClick:e[22]||(e[22]=a=>m(o.feature.js_security_domain))},{default:i(()=>[c(s(t(l)("xmwechat.offiaccount.config.Copy")),1)]),_:1})]),_:1},8,["modelValue"]),z]),_:1},8,["label"]),n(w,{label:t(l)("xmwechat.offiaccount.config.WebsiteAuthDomain")},{default:i(()=>[n(b,{type:"string",modelValue:o.feature.website_auth_domain,"onUpdate:modelValue":e[25]||(e[25]=a=>o.feature.website_auth_domain=a),prop:"website_auth_domain",readonly:""},{append:i(()=>[n(f,{onClick:e[24]||(e[24]=a=>m(o.feature.website_auth_domain))},{default:i(()=>[c(s(t(l)("xmwechat.offiaccount.config.Copy")),1)]),_:1})]),_:1},8,["modelValue"]),W]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["title"])]),_:1},8,["modelValue"])]),_:1})]),_:1})])}}}),ne=R(G,[["__scopeId","data-v-751f5b7c"]]);export{ne as default};