|
|
@ -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']; |
|
|
|