发送短信 #409

Merged
zhengdegang merged 1 commits from zdg into main 2024-11-19 11:17:05 +08:00
1 changed files with 6 additions and 4 deletions

View File

@ -28,7 +28,7 @@
<el-input v-model="ruleForm.phoneNumber" placeholder="请输入手机号" /> <el-input v-model="ruleForm.phoneNumber" placeholder="请输入手机号" />
</el-form-item> </el-form-item>
<el-form-item label="验证码" prop="Code" v-if="activeIndex==1"> <el-form-item label="验证码" prop="Code" v-if="activeIndex==1">
<el-input style="width:60%" v-model="ruleForm.Code" :disabled="true" placeholder="请输入验证码" /> <el-input style="width:60%" v-model="ruleForm.Code" :disabled="false" placeholder="请输入验证码" />
<el-button type="primary" style="margin-left:10px" @click="sendcaptchaImg">发送验证码</el-button> <el-button type="primary" style="margin-left:10px" @click="sendcaptchaImg">发送验证码</el-button>
</el-form-item> </el-form-item>
<el-form-item label="设置密码" prop="password" v-if="activeIndex==1"> <el-form-item label="设置密码" prop="password" v-if="activeIndex==1">
@ -409,11 +409,13 @@ const sbmitImg=()=>{
type: type.value type: type.value
} }
sendCode(params).then(res=>{ sendCode(params).then(res=>{
isImg.value=false
if(res.code==200){ if(res.code==200){
ruleForm.Code=res.data // ruleForm.Code=res.data
isImg.value=false ElMessage.success(res.msg||'验证码-已发送')
} }
}).catch(err=>{
isImg.value=false
}) })
}else{ }else{
ElMessage.error('请根据图片输入验证码') ElMessage.error('请根据图片输入验证码')