Browse Source

修复部分用户无法登录的BUG

dev
xiaoz 6 years ago
parent
commit
d4d10f5309
  1. 4
      application/helpers/basic_helper.php
  2. 2
      application/libraries/Basic.php

4
application/helpers/basic_helper.php

@ -31,14 +31,14 @@ @@ -31,14 +31,14 @@
//创建token
function token($user,$pass){
//token生成算法为:用户名 + md5后的密码 + ip + ua
$token = $user.$pass.get_ip().get_ua();
$token = $user.$pass.get_ua();
$token = md5($token);
return $token;
}
//判断用户是否登录
function is_login($user,$pass){
$token = $user.$pass.get_ip().get_ua();
$token = $user.$pass.get_ua();
$token = md5($token);
$username = $_COOKIE['user'];

2
application/libraries/Basic.php

@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
$username = $userinfo->username;
$password = $userinfo->password;
//echo get_ip();
$password = $username.$password.get_ip().get_ua();
$password = $username.$password.get_ua();
$password = md5($password);

Loading…
Cancel
Save