【修改】修改密码提示语长度
This commit is contained in:
@@ -201,7 +201,7 @@ Page({
|
|||||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||||
if(!pattern.test(e.detail.value.password)){
|
if(!pattern.test(e.detail.value.password)){
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: '密码长度至少8位,并包括大、小写英文字母、特殊字符!',
|
title: '密码至少八位,需包含大小写字母、数字、特殊符号',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
this.data.flag = false
|
this.data.flag = false
|
||||||
|
|||||||
@@ -211,9 +211,9 @@ Page({
|
|||||||
return
|
return
|
||||||
} else if (this.data.prePageData.password && !passwordReg(this.data.prePageData.password)) {
|
} else if (this.data.prePageData.password && !passwordReg(this.data.prePageData.password)) {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: '密码长度至少8位,并包括大、小写英文字母、特殊字符',
|
title: '密码至少八位,需包含大小写字母、数字、特殊符号',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 800
|
duration: 2000
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -578,7 +578,7 @@ Page({
|
|||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: message,
|
title: message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 800
|
duration: 2000
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
} else if (passwordReg(value)) {
|
} else if (passwordReg(value)) {
|
||||||
@@ -590,7 +590,7 @@ Page({
|
|||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: errmsg,
|
title: errmsg,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 800
|
duration: 2000
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
<view class="item" wx:if="{{currentTab === 1}}">
|
<view class="item" wx:if="{{currentTab === 1}}">
|
||||||
<view class="label validate">密码</view>
|
<view class="label validate">密码</view>
|
||||||
<view class="value text-password">
|
<view class="value text-password">
|
||||||
<input name="password" value="{{password}}" maxlength="50" password="{{show}}" placeholder="请输入密码" bindblur="validatePsd" data-message='请输入密码' data-errmsg='密码长度至少8位,并包括大、小写英文字母、特殊字符'
|
<input name="password" value="{{password}}" maxlength="50" password="{{show}}" placeholder="请输入密码" bindblur="validatePsd" data-message='请输入密码' data-errmsg='密码至少八位,需包含大小写字母、数字、特殊符号'
|
||||||
bindinput="handlePasswordInput" />
|
bindinput="handlePasswordInput" />
|
||||||
<image src="../../assets/images/show.png" class="show" wx:if="{{!show}}" bindtap="showPassword"></image>
|
<image src="../../assets/images/show.png" class="show" wx:if="{{!show}}" bindtap="showPassword"></image>
|
||||||
<image src="../../assets/images/none.png" class="show" wx:if="{{show}}" bindtap="showPassword"></image>
|
<image src="../../assets/images/none.png" class="show" wx:if="{{show}}" bindtap="showPassword"></image>
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ Page({
|
|||||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||||
if(!pattern.test(e.detail.value.newPassword)){
|
if(!pattern.test(e.detail.value.newPassword)){
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: '密码由8位及以上数字、大小写字母和特殊符号组成!',
|
title: '密码至少八位,需包含大小写字母、数字、特殊符号',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
this.data.flag = false
|
this.data.flag = false
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ Page({
|
|||||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||||
if(!pattern.test(e.detail.value.oldpassword)){
|
if(!pattern.test(e.detail.value.oldpassword)){
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: '密码由8位及以上数字、大小写字母和特殊符号组成!',
|
title: '密码至少八位,需包含大小写字母、数字、特殊符号',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
this.data.flag = false
|
this.data.flag = false
|
||||||
@@ -173,7 +173,7 @@ Page({
|
|||||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||||
if(!pattern.test(e.detail.value.password)){
|
if(!pattern.test(e.detail.value.password)){
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: '密码由8位及以上数字、大小写字母和特殊符号组成!',
|
title: '密码至少八位,需包含大小写字母、数字、特殊符号',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
this.data.flag = false
|
this.data.flag = false
|
||||||
@@ -193,7 +193,7 @@ Page({
|
|||||||
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/
|
||||||
if(!pattern.test(e.detail.value.confirmpassword)){
|
if(!pattern.test(e.detail.value.confirmpassword)){
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: '密码由8位及以上数字、大小写字母和特殊符号组成!',
|
title: '密码至少八位,需包含大小写字母、数字、特殊符号',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
this.data.flag = false
|
this.data.flag = false
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ export function isURL(s) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 密码
|
* 密码
|
||||||
* message: 密码长度至少8位,并包括数字、小写字母、大写字母和特殊符号4类
|
* message: 密码至少八位,需包含大小写字母、数字、特殊符号
|
||||||
*/
|
*/
|
||||||
export function passwordReg(s) {
|
export function passwordReg(s) {
|
||||||
return /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,30}$/.test(s)
|
return /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,30}$/.test(s)
|
||||||
|
|||||||
Reference in New Issue
Block a user