MinecraftAccount/Application/Common/Common/function.php

21 lines
448 B
PHP
Raw Normal View History

<?php
/**
* 检测用户是否登录
* @return integer 0-未登录大于0-当前登录用户ID
*/
function is_login() {
$user = session ( 'user' );
if (empty ( $user )) {
return 0;
} else {
return $user ['uid'];
}
}
/**
* 检测输入的验证码是否正确
* @return boolean 正确返回TRUE
*/
function check_verify($code, $id = '') {
$verify = new \Think\Verify ();
return $verify->check ( $code, $id );
}