Merge branch 'weixin_guange' into develop

This commit is contained in:
yuanke 2016-10-21 14:12:19 +08:00
commit 108c28be9d
4 changed files with 37 additions and 23 deletions

View File

@ -6,7 +6,7 @@ unless RUBY_PLATFORM =~ /w32/
if RUBY_PLATFORM =~ /darwin/
gem "rmagick", "= 2.15.4" ## osx must be this version
elsif RUBY_PLATFORM =~ /linux/
#gem "rmagick", "= 2.13.1" ## centos yum install ImageMagick-devel
gem "rmagick", "= 2.13.1" ## centos yum install ImageMagick-devel
end
gem 'certified'
gem 'net-ssh', '2.9.1'

View File

@ -43,22 +43,31 @@
var $password_confirmation = $('#user_password_confirmation')
$login.blur(function (event) {
if ($(this).is('#user_login')) {
$.get(
'<%=account_valid_ajax_path%>',
{ valid: "login",
value: this.value },
function (data) {
if (data.valid) {
$('#login_req').html('<span style="color: green">'+data.message+'</span>');
$login_correct = true;
} else {
$('#login_req').html( '<span style="color: #c00202">'+data.message+'</span>');
$login_correct = false;
}
$('#login_req').css('display','block');
});
if (/^[a-zA-Z][a-zA-Z\d]{3,14}$/.test(this.value) == false){
$('#login_req').html('<span style="color: #c00202">只能使用英文字母和数字必须以字母开头长度不少于4个字符、不超过15个字符</span>');
$('#login_req').show();
return ;
}
else{
$.get(
'<%=account_valid_ajax_path%>',
{ valid: "login",
value: this.value },
function (data) {
if (data.valid) {
$('#login_req').html('<span style="color: green">'+data.message+'</span>');
$login_correct = true;
} else {
$('#login_req').html( '<span style="color: #c00202">'+data.message+'</span>');
$login_correct = false;
}
$('#login_req').css('display','block');
});
}
}
;
// ;
});
$mail.blur(function (event) {
@ -185,9 +194,11 @@
<%= f.password_field :password_confirmation, :size => 25, :placeholder => "请再次输入密码", :class=> 'new_register_input' %>
<p class="new_login_error" id="confirm_req" style="display: none">两次密码不一致!</p>
</li>
<li class="new_register_li">
<li class="new_register_li mb8">
<%= f.text_field :login, :size => 25, :placeholder => "请输入用户登录名", :class => 'new_register_input'%>
<p class="new_login_error" id="login_req" style="display: none">用户登录名为2-18个中英文数字或下划线</p>
</li>
<li class="mb8">
<p class="new_login_error" id="login_req" style="display: none">只能使用英文字母和数字必须以字母开头长度不少于4个字符、不超过15个字符</p>
</li>
<li>
<label><input type="checkbox" checked id="read_and_confirm" onchange="changeRegisterBtn(this);" class=" new_login_check">我已阅读并接受<a href="<%= agreement_path %>" >Trustie服务协议条款</a></label>

View File

@ -26,11 +26,13 @@
<span class="f12 c-red fl" ng-show="regFrm.password_confirm.$error.pwdconfirm">两次密码不一致</span>
</div>
</div>
<div class="input-box-wrap login-wrap mb20">
<input class="input-box" required ng-model="user.username" name="username" placeholder="请输入登录名(英文字母、数字和下划线)" unconfirm/>
<div class="input-box-wrap login-wrap mb5">
<input class="input-box" required ng-model="user.username" name="username" placeholder="请输入登录名(英文字母和数字)" unconfirm/>
</div>
<div class="input-box-wrap login-wrap mb5">
<div ng-show="regFrm.$submitted || regFrm.username.$touched">
<span class="f12 c-red fl" ng-show="regFrm.username.$error.required">登录名不能为空</span>
<span class="f12 c-red fl" ng-show="regFrm.username.$error.unconfirm">不能以下划线开头不能包括中文长度不超过25个字符</span>
<span class="f12 c-red" ng-show="regFrm.username.$error.required">登录名不能为空</span>
<span class="f12 c-red" ng-show="regFrm.username.$error.unconfirm">只能使用英文字母和数字必须以字母开头长度不少于4个字符、不超过15个字符</span>
</div>
</div>

View File

@ -17,7 +17,8 @@ app.directive('unconfirm', function(){
if(viewValue == ""){
return true;
}
return (/^[a-zA-Z\d]\w{0,23}[a-zA-Z\d]{0,1}$/.test(viewValue));
// return (/^[a-zA-Z\d]\w{0,23}[a-zA-Z\d]{0,1}$/.test(viewValue));
return (/^[a-zA-Z][a-zA-Z\d]{3,14}$/.test(viewValue));
}
}
}