全栈小学生 c665981070 up
2025-05-23 14:56:18 +08:00

2 lines
8.5 KiB
JavaScript

import{d as $,v as j,f as K,r as y,l as V,V as O,k as e,aq as I,ae as W,W as k,h as g,c as L,e as t,w as l,u as o,ar as F,J as G,m as x,a as n,t as i,B as H,i as f,as as Q,K as J,D as X,G as Y,a8 as Z,a9 as ee,H as oe,E as te,L as ae}from"./index-08dd4327.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import le from"./index-201251e1.js";import"./el-form-item-4ed993c7.js";/* empty css *//* empty css *//* empty css */import{g as re,b as se,e as ie}from"./wechat-85c9391d.js";/* empty css */import"./index.vue_vue_type_style_index_0_lang-0b9ab171.js";/* empty css *//* empty css */import"./attachment-b0910b84.js";import"./index.vue_vue_type_script_setup_true_lang-2b567824.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index.vue_vue_type_script_setup_true_lang-c49efe6d.js";/* empty css */import"./index.vue_vue_type_script_setup_true_lang-6c641cdd.js";import"./sys-c2b6ae2b.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./sortable.esm-be94e56d.js";const ne={class:"main-container"},de={class:"panel-title !text-sm"},pe={class:"form-tip"},ce={class:"panel-title !text-sm"},ue={class:"form-tip"},me={class:"form-tip"},_e={class:"panel-title !text-sm"},he={class:"form-tip"},fe={class:"form-tip"},be={class:"form-tip"},ge={class:"form-tip"},ve={class:"form-tip"},we={class:"flex"},ye={class:"panel-title !text-sm"},Ve={class:"form-tip"},ke={class:"fixed-footer-wrap"},xe={class:"fixed-footer"},po=$({__name:"config",setup(Pe){const P=j(),S=K(),E=P.meta.title,C=()=>{S.push("/channel/wechat")},m=y(!0),r=V({wechat_name:"",wechat_original:"",app_id:"",app_secret:"",qr_code:"",token:"",encoding_aes_key:"",encryption_type:"not_encrypt",is_authorization:0}),v=y(),M=O(()=>({wechat_name:[{required:!0,message:e("wechatNamePlaceholder"),trigger:"blur"}],wechat_original:[{required:!0,message:e("wechatOriginalPlaceholder"),trigger:"blur"}],app_id:[{required:!0,message:e("appidPlaceholder"),trigger:"blur"}],app_secret:[{required:!r.is_authorization,message:e("appSecretPlaceholder"),trigger:"blur"}],token:[{required:!0,message:e("tokenPlaceholder"),trigger:"blur"}],encoding_aes_key:[{required:!0,message:e("encodingAesKeyPlaceholder"),trigger:"blur"}]}));re().then(u=>{Object.assign(r,u.data),m.value=!1});const c=V({business_domain:"",js_secure_domain:"",serve_url:"",web_auth_domain:""});se().then(u=>{Object.assign(c,u.data),m.value=!1});const{copy:T,isSupported:q,copied:w}=I(),h=u=>{if(!q.value){k({message:e("notSupportCopy"),type:"warning"});return}T(u)};W(w,()=>{w.value&&k({message:e("copySuccess"),type:"success"})});const A=async u=>{m.value||!u||await u.validate(async a=>{a&&(m.value=!0,ie(r).then(()=>{m.value=!1}).catch(()=>{m.value=!1}))})};return(u,a)=>{const U=Q,_=J,p=X,d=Y,D=le,b=Z,N=ee,R=oe,B=te,z=ae;return g(),L("div",ne,[t(_,{class:"card !border-none",shadow:"never"},{default:l(()=>[t(U,{content:o(E),icon:o(F),onBack:a[0]||(a[0]=s=>C())},null,8,["content","icon"])]),_:1}),G((g(),x(R,{class:"page-form mt-[15px]",model:r,"label-width":"150px",ref_key:"formRef",ref:v,rules:o(M)},{default:l(()=>[t(_,{class:"box-card !border-none",shadow:"never"},{default:l(()=>[n("h3",de,i(o(e)("wechatInfo")),1),t(d,{label:o(e)("wechatName"),prop:"wechat_name"},{default:l(()=>[t(p,{modelValue:r.wechat_name,"onUpdate:modelValue":a[1]||(a[1]=s=>r.wechat_name=s),modelModifiers:{trim:!0},placeholder:o(e)("wechatNamePlaceholder"),class:"input-width",clearable:"",readonly:r.is_authorization},null,8,["modelValue","placeholder","readonly"])]),_:1},8,["label"]),t(d,{label:o(e)("wechatOriginal"),prop:"wechat_original"},{default:l(()=>[t(p,{modelValue:r.wechat_original,"onUpdate:modelValue":a[2]||(a[2]=s=>r.wechat_original=s),modelModifiers:{trim:!0},placeholder:o(e)("wechatOriginalPlaceholder"),class:"input-width",clearable:"",readonly:r.is_authorization},null,8,["modelValue","placeholder","readonly"])]),_:1},8,["label"]),t(d,{label:o(e)("wechatQrcode"),prop:"qr_code"},{default:l(()=>[t(D,{modelValue:r.qr_code,"onUpdate:modelValue":a[3]||(a[3]=s=>r.qr_code=s)},null,8,["modelValue"]),n("div",pe,i(o(e)("wechatQrcodeTips")),1)]),_:1},8,["label"])]),_:1}),t(_,{class:"box-card !border-none mt-[15px]",shadow:"never"},{default:l(()=>[n("h3",ce,i(o(e)("wechatDevelopInfo")),1),t(d,{label:o(e)("wechatAppid"),prop:"app_id"},{default:l(()=>[t(p,{modelValue:r.app_id,"onUpdate:modelValue":a[4]||(a[4]=s=>r.app_id=s),modelModifiers:{trim:!0},placeholder:o(e)("appidPlaceholder"),class:"input-width",clearable:"",readonly:r.is_authorization},null,8,["modelValue","placeholder","readonly"]),n("div",ue,i(o(e)("wechatAppidTips")),1)]),_:1},8,["label"]),r.is_authorization?H("",!0):(g(),x(d,{key:0,label:o(e)("wechatAppsecret"),prop:"app_secret"},{default:l(()=>[t(p,{modelValue:r.app_secret,"onUpdate:modelValue":a[5]||(a[5]=s=>r.app_secret=s),modelModifiers:{trim:!0},placeholder:o(e)("appSecretPlaceholder"),class:"input-width",clearable:""},null,8,["modelValue","placeholder"]),n("div",me,i(o(e)("wechatAppsecretTips")),1)]),_:1},8,["label"]))]),_:1}),t(_,{class:"box-card !border-none mt-[15px]",shadow:"never"},{default:l(()=>[n("h3",_e,i(o(e)("theServerSetting")),1),t(d,{label:"URL"},{default:l(()=>[t(p,{"model-value":c.serve_url,placeholder:"Please input",class:"input-width",readonly:!0},{append:l(()=>[n("div",{class:"cursor-pointer",onClick:a[6]||(a[6]=s=>h(c.serve_url))},i(o(e)("copy")),1)]),_:1},8,["model-value"])]),_:1}),t(d,{label:"Token",prop:"token"},{default:l(()=>[t(p,{modelValue:r.token,"onUpdate:modelValue":a[7]||(a[7]=s=>r.token=s),modelModifiers:{trim:!0},placeholder:o(e)("tokenPlaceholder"),class:"input-width",maxlength:"32","show-word-limit":"",clearable:""},null,8,["modelValue","placeholder"]),n("div",he,i(o(e)("tokenTips")),1)]),_:1}),t(d,{label:"EncodingAESKey",prop:"encoding_aes_key"},{default:l(()=>[t(p,{modelValue:r.encoding_aes_key,"onUpdate:modelValue":a[8]||(a[8]=s=>r.encoding_aes_key=s),modelModifiers:{trim:!0},placeholder:o(e)("encodingAesKeyPlaceholder"),class:"input-width",maxlength:"43","show-word-limit":"",clearable:""},null,8,["modelValue","placeholder"]),n("div",fe,i(o(e)("encodingAESKeyTips")),1)]),_:1}),t(d,{label:o(e)("encryptionType"),prop:"encryption_type"},{default:l(()=>[t(N,{modelValue:r.encryption_type,"onUpdate:modelValue":a[9]||(a[9]=s=>r.encryption_type=s)},{default:l(()=>[t(b,{label:"not_encrypt"},{default:l(()=>[f(i(o(e)("cleartextMode")),1)]),_:1}),t(b,{label:"compatible"},{default:l(()=>[f(i(o(e)("compatibleMode")),1)]),_:1}),t(b,{label:"safe"},{default:l(()=>[f(i(o(e)("safeMode")),1)]),_:1})]),_:1},8,["modelValue"]),n("div",be,i(o(e)("cleartextModeTips")),1),n("div",ge,i(o(e)("compatibleModeTips")),1),n("div",ve,i(o(e)("safeModeTips")),1)]),_:1},8,["label"])]),_:1}),t(_,{class:"box-card !border-none mt-[15px]",shadow:"never"},{default:l(()=>[n("div",we,[n("h3",ye,i(o(e)("functionSetting")),1)]),t(d,{label:""},{default:l(()=>[n("div",Ve,i(o(e)("functionSettingTips")),1)]),_:1}),t(d,{label:o(e)("businessDomain")},{default:l(()=>[t(p,{"model-value":c.business_domain,placeholder:"Please input",class:"input-width",readonly:!0},{append:l(()=>[n("div",{class:"cursor-pointer",onClick:a[10]||(a[10]=s=>h(c.business_domain))},i(o(e)("copy")),1)]),_:1},8,["model-value"])]),_:1},8,["label"]),t(d,{label:o(e)("jsSecureDomain")},{default:l(()=>[t(p,{"model-value":c.js_secure_domain,placeholder:"Please input",class:"input-width",readonly:!0},{append:l(()=>[n("div",{class:"cursor-pointer",onClick:a[11]||(a[11]=s=>h(c.business_domain))},i(o(e)("copy")),1)]),_:1},8,["model-value"])]),_:1},8,["label"]),t(d,{label:o(e)("webAuthDomain")},{default:l(()=>[t(p,{"model-value":c.web_auth_domain,placeholder:"Please input",class:"input-width",readonly:!0},{append:l(()=>[n("div",{class:"cursor-pointer",onClick:a[12]||(a[12]=s=>h(c.business_domain))},i(o(e)("copy")),1)]),_:1},8,["model-value"])]),_:1},8,["label"])]),_:1})]),_:1},8,["model","rules"])),[[z,m.value]]),n("div",ke,[n("div",xe,[t(B,{type:"primary",loading:m.value,onClick:a[13]||(a[13]=s=>A(v.value))},{default:l(()=>[f(i(o(e)("save")),1)]),_:1},8,["loading"])])])])}}});export{po as default};