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

import{_ as S}from"./index.vue_vue_type_script_setup_true_lang-BTce45WY.js";import{d as P,m as U,r as V,a as F,p as i,g as W,c as B,b as e,w as t,h as c,e as s,G as v,j,_ as N,k as C}from"./index-nGFMSQGw.js";import{a as y}from"./config-CYXO1pNF.js";const $=s("div",{class:"flex items-center gap-4"},"认证设置",-1),A=s("div",{class:"text-sm/6"},[s("div",null,[c(" 实名认证接口使用阿里云"),s("a",{href:"https://market.aliyun.com/apimarket/detail/cmapi026109#sku=yuncode20109000025",target:"_blank"},"实名认证"),c("，需自行开通并获取 appCode。 ")]),s("div",null," 开启实名认证/手机号验证后，当用户对话条数超过对应阈值时，将会触发实名认证/手机号验证。 "),s("div",null,"触发优先级：手机号验证 > 实名认证"),s("div",null," 开启敏感词过滤后，将会对用户发送以及 AI 回复的消息进行敏感词过滤。 ")],-1),E=P({__name:"identityVerification",setup(H){const o=U({appCode:"",openIdentity:"",openPhoneValidation:"",phoneValidationMessageCount:"",identityVerificationMessageCount:"",isSensitiveWordFilter:""}),b=V({appCode:[{required:!0,trigger:"blur",message:"请填写身份认证appCode"}],openIdentity:[{required:!0,trigger:"blur",message:"请选择是否开启身份认证"}],openPhoneValidation:[{required:!0,trigger:"blur",message:"请选择是否开启手机号验证"}],phoneValidationMessageCount:[{required:!0,trigger:"blur",message:"请填写消息数量"}],identityVerificationMessageCount:[{required:!0,trigger:"blur",message:"请填写消息数量"}],isSensitiveWordFilter:[{required:!0,trigger:"blur",message:"请选择是否开启敏感词过滤"}]}),f=V();async function _(){const a=await y.queryConfig({keys:["appCode","openIdentity","openPhoneValidation","phoneValidationMessageCount","identityVerificationMessageCount","isSensitiveWordFilter"]});Object.assign(o,a.data)}function x(){var a;(a=f.value)==null||a.validate(async l=>{if(l){try{await y.setConfig({settings:h(o)}),v.success("变更配置信息成功")}catch{}_()}else v.error("请填写完整信息")})}function h(a){return Object.keys(a).map(l=>({configKey:l,configVal:a[l]}))}return F(()=>{_()}),(a,l)=>{const g=j,M=N,w=S,p=i("el-switch"),k=i("el-tooltip"),d=i("el-form-item"),r=i("el-col"),u=i("el-row"),m=i("el-input"),I=i("el-form"),q=i("el-card");return W(),B("div",null,[e(w,null,{title:t(()=>[$]),content:t(()=>[A]),default:t(()=>[e(M,{outline:"",onClick:x},{default:t(()=>[e(g,{name:"i-ri:file-text-line"}),c(" 保存设置 ")]),_:1})]),_:1}),e(q,{style:{margin:"20px"}},{default:t(()=>[e(I,{ref_key:"formRef",ref:f,rules:b.value,model:o,"label-width":"150px"},{default:t(()=>[e(u,null,{default:t(()=>[e(r,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(d,{label:"开启实名验证",prop:"openIdentity"},{default:t(()=>[e(k,{content:"开启将打开实名验证",placement:"top","show-after":500},{default:t(()=>[e(p,{modelValue:o.openIdentity,"onUpdate:modelValue":l[0]||(l[0]=n=>o.openIdentity=n),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1}),e(u,null,{default:t(()=>[e(r,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(d,{label:"appCode",prop:"appCode"},{default:t(()=>[e(m,{modelValue:o.appCode,"onUpdate:modelValue":l[1]||(l[1]=n=>o.appCode=n),placeholder:"请填写实名认证 appCode",clearable:"",type:"password","show-password":""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(u,null,{default:t(()=>[e(r,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(d,{label:"开启手机号验证",prop:"openPhoneValidation"},{default:t(()=>[e(p,{modelValue:o.openPhoneValidation,"onUpdate:modelValue":l[2]||(l[2]=n=>o.openPhoneValidation=n),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(u,null,{default:t(()=>[e(r,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(d,{label:"手机号验证阈值",prop:"phoneValidationMessageCount"},{default:t(()=>[e(m,{modelValue:o.phoneValidationMessageCount,"onUpdate:modelValue":l[3]||(l[3]=n=>o.phoneValidationMessageCount=n),placeholder:"请填写消息数量",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(u,null,{default:t(()=>[e(r,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(d,{label:"实名认证阈值",prop:"identityVerificationMessageCount"},{default:t(()=>[e(m,{modelValue:o.identityVerificationMessageCount,"onUpdate:modelValue":l[4]||(l[4]=n=>o.identityVerificationMessageCount=n),placeholder:"请填写消息数量",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(u,null,{default:t(()=>[e(r,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(d,{label:"开启敏感词过滤",prop:"isSensitiveWordFilter"},{default:t(()=>[e(p,{modelValue:o.isSensitiveWordFilter,"onUpdate:modelValue":l[5]||(l[5]=n=>o.isSensitiveWordFilter=n),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof C=="function"&&C(E);export{E as default};
