/** * 由 Fantastic-admin 提供技术支持 * Powered by Fantastic-admin * Gitee https://gitee.com/hooray/fantastic-admin * Github https://github.com/hooray/fantastic-admin */ import{_ as C}from"./index-fd8a5577.js";import{a as g}from"./config-e611a8d0.js";import{d as I,Q as q,r as h,x as N,h as n,o as k,c as R,e,f as l,a as S,l as T,E as y,q as b}from"./index-e656eb90.js";const U={class:"flex justify-between"},L=S("b",null,"阿里云手机验证码配置",-1),j=I({__name:"phone",setup(B){const t=q({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(t,s.data)}function x(){var s;(s=d.value)==null||s.validate(async o=>{if(o){try{await g.setConfig({settings:V(t)}),y.success("变更配置信息成功")}catch{}m()}else y.error("请填写完整信息")})}function V(s){return Object.keys(s).map(o=>({configKey:o,configVal:s[o]}))}return N(()=>{m()}),(s,o)=>{const p=n("el-alert"),K=C,w=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"),v=n("el-form"),A=n("el-card");return k(),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(A,{style:{margin:"20px"}},{header:l(()=>[S("div",U,[L,e(w,{class:"button",text:"",onClick:x},{default:l(()=>[T(" 保存设置 ")]),_:1})])]),default:l(()=>[e(v,{ref_key:"formRef",ref:d,rules:P.value,model:t,"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:t.phoneLoginStatus,"onUpdate:modelValue":o[0]||(o[0]=a=>t.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:t.phoneRegisterStatus,"onUpdate:modelValue":o[1]||(o[1]=a=>t.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:t.aliPhoneAccessKeyId,"onUpdate:modelValue":o[2]||(o[2]=a=>t.aliPhoneAccessKeyId=a),placeholder:"请填写AccessKeyId",clearable:"",type:"password","show-password":""},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:t.aliPhoneAccessKeySecret,"onUpdate:modelValue":o[3]||(o[3]=a=>t.aliPhoneAccessKeySecret=a),placeholder:"请填写AccessKeySecret",clearable:"",type:"password","show-password":""},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:t.aliPhoneSignName,"onUpdate:modelValue":o[4]||(o[4]=a=>t.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:t.aliPhoneTemplateCode,"onUpdate:modelValue":o[5]||(o[5]=a=>t.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};