
/**
 * 由 Fantastic-admin 提供技术支持
 * Powered by Fantastic-admin
 * Gitee  https://gitee.com/hooray/fantastic-admin
 * Github https://github.com/hooray/fantastic-admin
 */
  
import{_ as I}from"./index-7911c6db.js";import{a as g}from"./config-b4a9e7c0.js";import{d as w,Q as k,r as h,x as q,o as N,c as R,e,f as l,a as S,k as T,E as y,h as n,q as b}from"./index-4eef28ae.js";const U={class:"flex justify-between"},L=S("b",null,"阿里云手机验证码配置",-1),j=w({__name:"phone",setup(B){const o=k({phoneRegisterStatus:"",phoneLoginStatus:"",aliPhoneAccessKeyId:"",aliPhoneAccessKeySecret:"",aliPhoneSignName:"",aliPhoneTemplateCode:""}),P=h({phoneRegisterStatus:[{required:!1,trigger:"blur",message:"请选择是否开启手机号注册"}],phoneLoginStatus:[{required:!1,trigger:"blur",message:"请选择是否开启手机号登录"}],aliPhoneAccessKeyId:[{required:!1,trigger:"blur",message:"请填写阿里云短信服务accessKeyId"}],aliPhoneAccessKeySecret:[{required:!1,trigger:"blur",message:"请填写阿里云短信服务accessKeySecret"}],aliPhoneSignName:[{required:!1,trigger:"blur",message:"请填写阿里云短信服务的模板签名"}],aliPhoneTemplateCode:[{required:!1,trigger:"blur",message:"请填写阿里云短信服务的模板ID"}]}),d=h();async function m(){const s=await g.queryConfig({keys:["phoneRegisterStatus","phoneLoginStatus","aliPhoneAccessKeyId","aliPhoneAccessKeySecret","aliPhoneSignName","aliPhoneTemplateCode"]});Object.assign(o,s.data)}function x(){var s;(s=d.value)==null||s.validate(async t=>{if(t){try{await g.setConfig({settings:V(o)}),y.success("变更配置信息成功")}catch{}m()}else y.error("请填写完整信息")})}function V(s){return Object.keys(s).map(t=>({configKey:t,configVal:s[t]}))}return q(()=>{m()}),(s,t)=>{const p=n("el-alert"),K=I,v=n("el-button"),f=n("el-switch"),_=n("el-tooltip"),r=n("el-form-item"),i=n("el-col"),c=n("el-row"),u=n("el-input"),A=n("el-form"),C=n("el-card");return N(),R("div",null,[e(K,null,{default:l(()=>[e(p,{closable:!1,"show-icon":"",title:"验证码说明",description:"此处采用阿里云短信服务、请先申请好个人的签名模板以及获取到您的秘钥信息、详细申请地址为：https://dysms.console.aliyun.com/overview 当您配置并开启后则表示开启用户端手机号注册的行为！",type:"warning"})]),_:1}),e(C,{style:{margin:"20px"}},{header:l(()=>[S("div",U,[L,e(v,{class:"button",text:"",onClick:x},{default:l(()=>[T(" 保存设置 ")]),_:1})])]),default:l(()=>[e(A,{ref_key:"formRef",ref:d,rules:P.value,model:o,"label-width":"170px"},{default:l(()=>[e(c,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"是否开启手机号登录",prop:"phoneLoginStatus"},{default:l(()=>[e(_,{class:"box-item",effect:"dark",content:"如您启用短信登录、则用户端则可以通过手机号的方式登录！",placement:"right"},{default:l(()=>[e(f,{modelValue:o.phoneLoginStatus,"onUpdate:modelValue":t[0]||(t[0]=a=>o.phoneLoginStatus=a),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1}),e(c,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"是否开启手机号注册",prop:"phoneRegisterStatus"},{default:l(()=>[e(_,{class:"box-item",effect:"dark",content:"如您启用短信验证、则用户端则可以通过手机验证码方式注册！",placement:"right"},{default:l(()=>[e(f,{modelValue:o.phoneRegisterStatus,"onUpdate:modelValue":t[1]||(t[1]=a=>o.phoneRegisterStatus=a),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1}),e(c,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"AccessKeyId",prop:"aliPhoneAccessKeyId"},{default:l(()=>[e(u,{modelValue:o.aliPhoneAccessKeyId,"onUpdate:modelValue":t[2]||(t[2]=a=>o.aliPhoneAccessKeyId=a),placeholder:"请填写AccessKeyId",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(c,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"AccessKeySecret",prop:"aliPhoneAccessKeySecret"},{default:l(()=>[e(u,{modelValue:o.aliPhoneAccessKeySecret,"onUpdate:modelValue":t[3]||(t[3]=a=>o.aliPhoneAccessKeySecret=a),placeholder:"请填写AccessKeySecret",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(c,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"短信签名",prop:"aliPhoneSignName"},{default:l(()=>[e(u,{modelValue:o.aliPhoneSignName,"onUpdate:modelValue":t[4]||(t[4]=a=>o.aliPhoneSignName=a),placeholder:"请填写您申请的短信签名",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(c,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"短信模板ID",prop:"aliPhoneTemplateCode"},{default:l(()=>[e(u,{modelValue:o.aliPhoneTemplateCode,"onUpdate:modelValue":t[5]||(t[5]=a=>o.aliPhoneTemplateCode=a),placeholder:"请填写短信模板ID",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof b=="function"&&b(j);export{j as default};
