Commit c1e3abf5 authored by wangjiangze's avatar wangjiangze

登录账号/密码进行MD5加密提交

parent b4aa012f
...@@ -30,7 +30,8 @@ class LoginAction extends Action{ ...@@ -30,7 +30,8 @@ class LoginAction extends Action{
return; return;
} }
if ($this->check_code($code)) { if ($this->check_code($code)) {
$where['account'] = $username; // $where['account'] = $username;
$where[md5('account')] = $username;
$where['password'] = $password; $where['password'] = $password;
$where['status'] = 1; $where['status'] = 1;
$r = $UserModel->where($where)->find(); $r = $UserModel->where($where)->find();
...@@ -149,7 +150,8 @@ class LoginAction extends Action{ ...@@ -149,7 +150,8 @@ class LoginAction extends Action{
$password=I('password'); $password=I('password');
$code=I('code'); $code=I('code');
$where['account'] = $username; // $where['account'] = $username;
$where[md5('account')] = $username;
$where['password'] = $password; $where['password'] = $password;
$where['status'] = 1; $where['status'] = 1;
$r = $UserModel->where($where)->find(); $r = $UserModel->where($where)->find();
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
function login(){ function login(){
$('input[name="username"]').val(hex_md5($("input#username").val()));
$('input[name="password"]').val(hex_md5($("input#password").val())); $('input[name="password"]').val(hex_md5($("input#password").val()));
$("#f").submit(); $("#f").submit();
} }
...@@ -88,7 +89,8 @@ ...@@ -88,7 +89,8 @@
<form id="f" action="{:U('Login/loginGa')}" method="POST"> <form id="f" action="{:U('Login/loginGa')}" method="POST">
<div class="inputWrap"> <div class="inputWrap">
<img src="__PUBLIC__/newVsdn/images/user.png" /> <img src="__PUBLIC__/newVsdn/images/user.png" />
<input id="username" name="username" type="text" placeholder="用户名" value="用户名" onclick="Focus(this);" onblur="Blur(this);" class="input" /> <input type="hidden" name="username" value=""/>
<input id="username" type="text" placeholder="用户名" value="用户名" onclick="Focus(this);" onblur="Blur(this);" class="input" />
</div> </div>
<div class="inputWrap"> <div class="inputWrap">
<img src="__PUBLIC__/newVsdn/images/password.png"/> <img src="__PUBLIC__/newVsdn/images/password.png"/>
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
function login(){ function login(){
$('input[name="username"]').val(hex_md5($("input#username").val()));
$('input[name="password"]').val(hex_md5($("input#password").val())); $('input[name="password"]').val(hex_md5($("input#password").val()));
$("#f").submit(); $("#f").submit();
} }
...@@ -92,7 +93,8 @@ ...@@ -92,7 +93,8 @@
<form id="f" action="{:U('Login/loginDo')}" method="POST"> <form id="f" action="{:U('Login/loginDo')}" method="POST">
<div class="inputWrap"> <div class="inputWrap">
<img src="__PUBLIC__/newVsdn/images/user.png" /> <img src="__PUBLIC__/newVsdn/images/user.png" />
<input id="username" name="username" type="text" placeholder="用户名" value="用户名" onclick="Focus(this);" onblur="Blur(this);" class="input" /> <input type="hidden" name="username" value=""/>
<input id="username" type="text" placeholder="用户名" value="用户名" onclick="Focus(this);" onblur="Blur(this);" class="input" />
</div> </div>
<div class="inputWrap"> <div class="inputWrap">
<img src="__PUBLIC__/newVsdn/images/password.png"/> <img src="__PUBLIC__/newVsdn/images/password.png"/>
......
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 to comment