优化初次登录改密码
This commit is contained in:
@@ -441,7 +441,7 @@ layout("/mobile/platform.html"){
|
||||
<mobile-sign-points></mobile-sign-points>
|
||||
</van-popup>
|
||||
|
||||
<van-popup v-model="updatePwdShow" class="pwd_popup">
|
||||
<van-popup v-model="updatePwdShow" class="pwd_popup" :close-on-click-overlay="false" :closeable="!formData.isFirstLogin">
|
||||
<div class="card modify-password">
|
||||
<div class="card-content">
|
||||
<h2>{{ formData.isFirstLogin ? '首次登录,请修改密码' : '修改密码' }}</h2>
|
||||
@@ -452,12 +452,12 @@ layout("/mobile/platform.html"){
|
||||
<span class="toggle-password" data-target="current-password">🔒</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="new-password">新密码</label>
|
||||
<label for="new-password">请输入新密码</label>
|
||||
<input type="password" id="new-password" name="new-password" maxlength="20" v-model="formData.newPwd" @blur="checkPwd" />
|
||||
<span class="toggle-password" data-target="new-password">🔒</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="confirm-password">确认新密码</label>
|
||||
<label for="confirm-password">请再次输入新密码</label>
|
||||
<input
|
||||
type="password"
|
||||
id="confirm-password"
|
||||
@@ -531,6 +531,14 @@ layout("/mobile/platform.html"){
|
||||
if (!this.formData.isFirstLogin && !this.formData.sourcePwd) {
|
||||
this.$toast("请输入原密码")
|
||||
}
|
||||
if (!this.formData.newPwd) {
|
||||
this.$toast("请输入新密码")
|
||||
return
|
||||
}
|
||||
if (!this.formData.confirmPwd) {
|
||||
this.$toast("请再次输入新密码")
|
||||
return
|
||||
}
|
||||
const resp = await $.post("/mobile/login/updatePwd", this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$toast("修改成功")
|
||||
@@ -555,8 +563,8 @@ layout("/mobile/platform.html"){
|
||||
checkConfirmPwd() {
|
||||
// 检验输入是否大于6位数
|
||||
if (!this.formData.confirmPwd) {
|
||||
this.errorInfo = "请输入确认新密码"
|
||||
this.$toast("请输入确认新密码")
|
||||
this.errorInfo = "请再次输入新密码"
|
||||
this.$toast("请再次输入新密码")
|
||||
return
|
||||
}
|
||||
if (this.formData.confirmPwd.length < 6) {
|
||||
@@ -565,8 +573,8 @@ layout("/mobile/platform.html"){
|
||||
return
|
||||
}
|
||||
if (this.formData.newPwd !== this.formData.confirmPwd) {
|
||||
this.errorInfo = "新密码与确认新密码不一致"
|
||||
this.$toast("新密码与确认新密码不一致")
|
||||
this.errorInfo = "新密码与再次输入新密码不一致"
|
||||
this.$toast("新密码与再次输入新密码不一致")
|
||||
return
|
||||
}
|
||||
this.errorInfo = ""
|
||||
|
||||
Reference in New Issue
Block a user