You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.1 KiB
67 lines
1.1 KiB
<?php
|
|
/**
|
|
* Created by 花密欧团队.
|
|
* User: 云掌.帮德
|
|
* Date: 2020/3/8 22:30
|
|
* Desc:
|
|
*/
|
|
|
|
namespace auth;
|
|
|
|
|
|
class SiteAuth
|
|
{
|
|
|
|
protected $table = 'site';
|
|
|
|
private static $instance = null;
|
|
|
|
private function __construct()
|
|
{
|
|
|
|
}
|
|
|
|
/**
|
|
* 禁止克隆
|
|
*/
|
|
private function __clone()
|
|
{
|
|
// TODO: Implement __clone() method.
|
|
}
|
|
|
|
/**
|
|
* 返回单例对象
|
|
* @return JwtAuth|null
|
|
*/
|
|
public static function getInstance()
|
|
{
|
|
if (!self::$instance instanceof self) {
|
|
self::$instance = new self();
|
|
}
|
|
return self::$instance;
|
|
}
|
|
|
|
/**
|
|
* 获取站点详细信息
|
|
* @param string $host
|
|
* @return mixed
|
|
*/
|
|
public function getSite($host = '')
|
|
{
|
|
//验证参数
|
|
validate(['host|域名' => 'require|activeUrl'])->check(['host' => $host]);
|
|
|
|
//返回数据
|
|
$_data = Db::name($this->table)->where('host', $host)->find();
|
|
return $_data;
|
|
}
|
|
|
|
/**
|
|
* 更新站点信息
|
|
*/
|
|
public function updateSite()
|
|
{
|
|
|
|
}
|
|
|
|
}
|