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

import{_ as C}from"./index.vue_vue_type_script_setup_true_lang-BTce45WY.js";import{d as q,m as B,r as b,a as U,p as n,g as j,c as I,b as e,w as t,h as d,e as r,G as x,j as N,_ as $,k as g}from"./index-nGFMSQGw.js";import{a as y}from"./config-CYXO1pNF.js";const E=r("div",{class:"flex items-center gap-4"},"百度文本审核参数设置",-1),H=r("div",{class:"text-sm/6"},[r("div",null,[d(" 当前百度云免费5万条，可查看"),r("a",{href:"https://console.bce.baidu.com/ai/#/ai/antiporn/overview/index",target:"_blank"},"使用文档"),d("，如果百度云敏感词与自定义敏感词都配置的情况，会先检测百度云后检测自定义的敏感词。 ")])],-1),M=q({__name:"baiduSensitive",setup(O){const l=B({baiduTextStatus:"",baiduTextApiKey:"",baiduTextSecretKey:""}),K=b({baiduTextStatus:[{required:!0,trigger:"blur",message:"请选择是否启用百度文本审核"}],baiduTextSecretKey:[{required:!0,trigger:"blur",message:"请填写百度文本审核SecretKey"}],baiduTextApiKey:[{required:!0,trigger:"blur",message:"请填写百度文本审核APIKey"}]}),_=b();async function m(){const o=await y.queryConfig({keys:["baiduTextStatus","baiduTextSecretKey","baiduTextApiKey"]});Object.assign(l,o.data)}function T(){var o;(o=_.value)==null||o.validate(async a=>{if(a){try{await y.setConfig({settings:S(l)}),x.success("变更配置信息成功")}catch{}m()}else x.error("请填写完整信息")})}function S(o){return Object.keys(o).map(a=>({configKey:a,configVal:o[a]}))}return U(()=>{m()}),(o,a)=>{const p=N,v=$,V=C,w=n("el-switch"),A=n("el-tooltip"),u=n("el-form-item"),s=n("el-col"),c=n("el-row"),f=n("el-input"),h=n("el-form"),k=n("el-card");return j(),I("div",null,[e(V,null,{title:t(()=>[E]),content:t(()=>[H]),default:t(()=>[e(v,{outline:"",onClick:T},{default:t(()=>[e(p,{name:"i-ri:file-text-line"}),d(" 保存设置 ")]),_:1})]),_:1}),e(k,{style:{margin:"20px"}},{default:t(()=>[e(h,{ref_key:"formRef",ref:_,rules:K.value,model:l,"label-width":"150px"},{default:t(()=>[e(c,null,{default:t(()=>[e(s,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(u,{label:"开启此敏感词设置",prop:"baiduTextStatus"},{default:t(()=>[e(A,{content:"开启将打开敏感词检测、如果同时开启其他敏感词将会通过菜单顺序仅同时开启一个！",placement:"top","show-after":500},{default:t(()=>[e(w,{modelValue:l.baiduTextStatus,"onUpdate:modelValue":a[0]||(a[0]=i=>l.baiduTextStatus=i),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1}),e(c,null,{default:t(()=>[e(s,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(u,{label:"文本审核ApiKey",prop:"baiduTextApiKey"},{default:t(()=>[e(f,{modelValue:l.baiduTextApiKey,"onUpdate:modelValue":a[1]||(a[1]=i=>l.baiduTextApiKey=i),placeholder:"请填写百度文本审核ApiKey",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(c,null,{default:t(()=>[e(s,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(u,{label:"文本审核SecretKey",prop:"baiduTextSecretKey"},{default:t(()=>[e(f,{modelValue:l.baiduTextSecretKey,"onUpdate:modelValue":a[2]||(a[2]=i=>l.baiduTextSecretKey=i),placeholder:"请填写百度文本审核SecretKey",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof g=="function"&&g(M);export{M as default};
