mirror of https://github.com/1099438829/apeblog
fix api报错
This commit is contained in:
parent
b660d17646
commit
903c3a4494
|
|
@ -30,52 +30,5 @@ class Base extends BaseController
|
||||||
protected function initialize()
|
protected function initialize()
|
||||||
{
|
{
|
||||||
parent::initialize();
|
parent::initialize();
|
||||||
|
|
||||||
$this->userInfo = Session::get(Data::SESSION_KEY_USER_INFO);
|
|
||||||
$this->userId = Session::get(Data::SESSION_KEY_USER_ID);
|
|
||||||
|
|
||||||
if ($this->userId){
|
|
||||||
//模板兼容性标签
|
|
||||||
$this->assign('user_info', $this->userInfo);
|
|
||||||
$this->assign('user_id', $this->userId);
|
|
||||||
}
|
|
||||||
//判断是否关闭站点。
|
|
||||||
if (web_config('web_close')==1) {
|
|
||||||
$this->error('网站暂时关闭!', '', 'stop');
|
|
||||||
}
|
|
||||||
//判断后台统计配置是否开启 1 开启
|
|
||||||
if (web_config("web_statistics") == 1) {
|
|
||||||
//pv表 zz_pv_log 栏目存在 点击进入页面后
|
|
||||||
$pvLogModel = new PvLog();
|
|
||||||
$pvLogModel->set_view();
|
|
||||||
}
|
|
||||||
cache(Data::CURR_CATEGORY_PATENT_ID, false);
|
|
||||||
//模板兼容性标签
|
|
||||||
$this->assign('id', false);
|
|
||||||
$this->assign('cid', false);
|
|
||||||
|
|
||||||
//获取根域名
|
|
||||||
//判断是否开启了伪静态
|
|
||||||
// if (web_config('web_rewrite')=='0') {
|
|
||||||
// $this->request->setRoot('/?s=');
|
|
||||||
// } elseif(web_config('web_rewrite')=='1') {
|
|
||||||
// $this->request->setRoot('/');
|
|
||||||
// } else {
|
|
||||||
// $this->request->setRoot('/index.php');
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* url 统计
|
|
||||||
* @param $title
|
|
||||||
* @author 木子的忧伤
|
|
||||||
* @date 2021-05-09 23:44
|
|
||||||
*/
|
|
||||||
protected function urlrecord($title)
|
|
||||||
{
|
|
||||||
$urlLogModel = new UrlLog();
|
|
||||||
//获取url
|
|
||||||
$urlInfo = $this->request->url(true);
|
|
||||||
$urlLogModel->set_url($title, $urlInfo);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -10,7 +10,7 @@ use app\common\constant\Data;
|
||||||
* Class Index
|
* Class Index
|
||||||
* @package app\index\controller
|
* @package app\index\controller
|
||||||
*/
|
*/
|
||||||
class Index extends AuthController
|
class Index extends Base
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 入口跳转链接
|
* 入口跳转链接
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue