|
|
@@ -7,11 +7,14 @@ |
|
|
|
<view class="btn" @click="sendCode">发送验证码</view> |
|
|
|
</view> |
|
|
|
<view class="content" v-if="type == 'checkCode'"> |
|
|
|
<l-input v-model="verifycode" placeholder="请输入验证码" left> |
|
|
|
<l-input v-model="phone" placeholder="请输入手机号" left disabled> |
|
|
|
<l-icon slot="title" type="phone" /> |
|
|
|
</l-input> |
|
|
|
<l-input v-model="verifycode" placeholder="请输入验证码" left password> |
|
|
|
<l-icon slot="title" type="lock" /> |
|
|
|
</l-input> |
|
|
|
<view style="margin-top: 4px;color: color: #606266;"> |
|
|
|
未收到验证码?<text :style="{color:time==0?'#409EFF':'#999'}" @click="()=>{if(time==0)(type='sendCode')}">重新发送</text> |
|
|
|
未收到验证码?<text :style="{color:time==0?'#409EFF':'#999'}" @click="()=>{if(time==0)type='sendCode'}">重新发送</text> |
|
|
|
{{time?'( '+time+ 's'+' )' :''}} |
|
|
|
</view> |
|
|
|
<view class="btn" @click="checkverifycode">下一步</view> |
|
|
@@ -32,7 +35,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import moment from 'moment'; |
|
|
|
// import moment from 'moment'; |
|
|
|
export default{ |
|
|
|
data() { |
|
|
|
return { |
|
|
@@ -48,6 +51,9 @@ export default{ |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
destroyed() { |
|
|
|
this.timeT && clearInterval(this.timeT) |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
// 发送验证码 |
|
|
|
sendCode(){ |
|
|
@@ -84,18 +90,12 @@ export default{ |
|
|
|
return |
|
|
|
} |
|
|
|
this.LOADING('正在校验...') |
|
|
|
let codeResult = await this.POST('learun/adms/user/logincodeverify', { |
|
|
|
let codeResult = await this.HTTP_POST('learun/adms/user/logincodeverify', { |
|
|
|
mobile: this.phone, |
|
|
|
verifycode: this.verifycode |
|
|
|
}) |
|
|
|
this.HIDE_LOADING() |
|
|
|
if (!codeResult || !codeResult[1] || !codeResult[1].data) { |
|
|
|
return |
|
|
|
} |
|
|
|
if (!codeResult[1].data.code || codeResult[1].data.code != 200) { |
|
|
|
this.TOAST(codeResult[1].data.info); |
|
|
|
return |
|
|
|
} |
|
|
|
if(!codeResult)return |
|
|
|
this.type = 'setPassword' |
|
|
|
}, |
|
|
|
// 设置密码 |
|
|
@@ -105,7 +105,7 @@ export default{ |
|
|
|
return |
|
|
|
} |
|
|
|
if(!/^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*,\.])[0-9a-zA-Z!@#$%^&*,\.]{8,20}$/.test(this.form.newpassword)){ |
|
|
|
this.TOAST('密码格式不正确,请重新输入'); |
|
|
|
this.TOAST('您的密码不满足强度要求,请重新输入'); |
|
|
|
return |
|
|
|
} |
|
|
|
if(!this.form.newpassword1){ |
|
|
@@ -117,17 +117,17 @@ export default{ |
|
|
|
return |
|
|
|
} |
|
|
|
this.LOADING() |
|
|
|
let result = await this.POST('learun/adms/user/forgetpass', { |
|
|
|
newpassword:this.MD5(this.form.newpassword), |
|
|
|
let res = await this.HTTP_POST('learun/adms/usernologin/forgetpass', { |
|
|
|
newpassword:this.form.newpassword, |
|
|
|
// this.MD5() |
|
|
|
phone:this.phone |
|
|
|
}).then(res=>{ |
|
|
|
this.HIDE_LOADING() |
|
|
|
if(!res)return |
|
|
|
this.TOAST('修改成功') |
|
|
|
setTimeout(()=>{ |
|
|
|
this.NAV_TO('/pages/login') |
|
|
|
},500) |
|
|
|
}) |
|
|
|
this.HIDE_LOADING() |
|
|
|
if(!res)return |
|
|
|
this.TOAST('修改成功') |
|
|
|
setTimeout(()=>{ |
|
|
|
this.NAV_TO('/pages/login') |
|
|
|
},500) |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|