Commit 72ad639a by 梁建民

login

parent df8211dd
......@@ -6,14 +6,14 @@
this.handleBind(this);
},
getUserName: function () {
var val = $("input[name='username']").val();
var val = $("input[name='account_name']").val();
if (val) {
return val;
}
return false;
},
getPasswd: function () {
var val = $("input[name='pwd']").val();
var val = $("input[name='password']").val();
if (val) {
return val;
}
......@@ -35,10 +35,10 @@
dataType: 'json',
timeout: 10000,
success: function (res) {
if (resp.code > 0) {
layer.msg(resp.msg);
} else {
if (res.code == 0) {
typeof callback == 'function' && callback(res);
} else {
layer.msg(res.msg);
}
},
error: function (res) {
......@@ -74,18 +74,23 @@
//提交
$(opt.submit).on('click', function () {
if (opt.calcForm(opt)) {
opt.getData(function (res) {
setCookie('yunxin_token', resp.data)
var params = {
'account_name': $("input[name='account_name']").val(),
'password': $.md5($("input[name='password']").val()),
'code': $("input[name='code']").val()
}
opt.getData(params, function (res) {
Util.setCookie('yunxin_token', res.data,1,cookieHostname)
window.location.href = "/web/orderList"
});
}
});
$("input[name='username']").on('blur', function () {
$("input[name='account_name']").on('blur', function () {
opt.calcForm(opt);
});
$("input[name='pwd']").on('blur', function () {
$("input[name='password']").on('blur', function () {
opt.calcForm(opt);
});
......
......@@ -101,5 +101,5 @@
window.Util = Util;
}
})(window);
var cookieHostname = window.location.hostname.split(".")[1] + "." + window.location.hostname.split(".")[2];
......@@ -42,14 +42,14 @@
<i class="icn i-1"></i>
<b class="lineBlock emptys"></b>
</div>
<input type="text" placeholder="请输入手机号/邮箱/企业用户名" name="username">
<input type="text" placeholder="请输入手机号/邮箱/企业用户名" name="account_name">
</div>
<div class="inp-wrap">
<div class="arr">
<i class="icn i-2"></i>
<b class="lineBlock emptys"></b>
</div>
<input type="text" placeholder="请输入登录密码" name="pwd">
<input type="text" placeholder="请输入登录密码" name="password">
</div>
<div class="code clr">
<div class="code-inp fl">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment