| | |
| | | <div class="rowTitle">新密码</div> |
| | | <u-input input-align="right" v-model="passwordForm.newPassword" placeholder="请输入" |
| | | class="input-item" /> |
| | | |
| | | |
| | | </div> |
| | | <div class="orderRow"> |
| | | <div class="rowTitle">确认密码</div> |
| | |
| | | const validatePasswordNoChinese = (password) => { |
| | | const chineseRegex = /[\u4e00-\u9fa5]/; |
| | | if (chineseRegex.test(password)) { |
| | | |
| | | |
| | | uni.showToast({ |
| | | title: '密码不能包含中文字符', |
| | | icon: 'none', |
| | |
| | | // 校验密码复杂度(长度≥6位,包含字母和数字) |
| | | const validatePasswordStrength = (password) => { |
| | | if (password.length < 6) { |
| | | |
| | | |
| | | uni.showToast({ |
| | | title: '密码长度不能少于6位', |
| | | icon: 'none', |
| | |
| | | const submit = () => { |
| | | // 原始密码校验 |
| | | if (!passwordForm.value.oldPassword) { |
| | | |
| | | |
| | | uni.showToast({ |
| | | title: '请输入原始密码', |
| | | icon: 'none', |
| | |
| | | if (!validatePasswordNoChinese(passwordForm.value.newPassword)) return; |
| | | // 新密码校验 |
| | | if (!passwordForm.value.newPassword) { |
| | | |
| | | |
| | | uni.showToast({ |
| | | title: '请输入新密码', |
| | | icon: 'none', |
| | |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | |
| | | // 复杂度校验 |
| | | if (!validatePasswordStrength(passwordForm.value.newPassword)) return; |
| | | updatePassword(md5(passwordForm.value.oldPassword), |
| | |
| | | }); |
| | | clearForm(); |
| | | userStore.setUserInfo(null) |
| | | uni.redirectTo({ |
| | | uni.reLaunch({ |
| | | url: '/pages/login/index' |
| | | }) |
| | | |
| | |
| | | height: 96rpx; |
| | | border-bottom: 2rpx solid #f5f5f5; |
| | | color: #7b7b7b; |
| | | |
| | | |
| | | |
| | | .rowTitle { |
| | | font-family: Source Han Sans CN, Source Han Sans CN; |
| | |
| | | .u-button:first-child{ |
| | | margin-right: 30rpx; |
| | | } |
| | | |
| | | |
| | | .custom-style { |
| | | width: 276rpx; |
| | | height: 76rpx; |
| | | } |
| | | </style> |
| | | </style> |