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

2
application/libraries/Basic.php

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

Loading…
Cancel
Save