找回密码校验及logobrand js @review by 王成龙
Showing
2 changed files
with
7 additions
and
0 deletions
@@ -79,6 +79,10 @@ var $ = require('yoho.jquery'), | @@ -79,6 +79,10 @@ var $ = require('yoho.jquery'), | ||
79 | var brandTpl, | 79 | var brandTpl, |
80 | brandHtml; | 80 | brandHtml; |
81 | 81 | ||
82 | + if (!data || data.length === 0) { | ||
83 | + return; | ||
84 | + } | ||
85 | + | ||
82 | that._createHelper(); | 86 | that._createHelper(); |
83 | brandHtml = '\{{#brandList logoBrand}}' + | 87 | brandHtml = '\{{#brandList logoBrand}}' + |
84 | '<a href="\{{href}}" target="_blank"><img class="lazy" data-original="\{{img}}" alt=""></a>' + | 88 | '<a href="\{{href}}" target="_blank"><img class="lazy" data-original="\{{img}}" alt=""></a>' + |
@@ -174,6 +174,9 @@ $('.va').keyup(function() { | @@ -174,6 +174,9 @@ $('.va').keyup(function() { | ||
174 | } else if (v.length < 6 || v.length > 20) { | 174 | } else if (v.length < 6 || v.length > 20) { |
175 | $(this).addClass('error'); | 175 | $(this).addClass('error'); |
176 | $pwdErr.removeClass('hide').find('em').text('密码只支持6-20位'); | 176 | $pwdErr.removeClass('hide').find('em').text('密码只支持6-20位'); |
177 | + } else if (/^([a-zA-Z0-9\-\+_!@\#$%\^&\*\(\)\:\;\.=\[\]\\\',\?]){6,20}$/.test(v)) { | ||
178 | + $(this).addClass('error'); | ||
179 | + $pwdErr.removeClass('hide').find('em').text('密码不能包含特殊字符'); | ||
177 | } else { | 180 | } else { |
178 | $pwdErr.addClass('hide'); | 181 | $pwdErr.addClass('hide'); |
179 | if ($repwd.val() !== '') { | 182 | if ($repwd.val() !== '') { |
-
Please register or login to post a comment