MinecraftAccount/Application/Common/Common/function.php

21 lines
448 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?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 );
}