fix api报错

This commit is contained in:
yumo 2023-09-27 17:44:06 +08:00
parent b660d17646
commit 903c3a4494
2 changed files with 1 additions and 48 deletions

View File

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

View File

@ -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
{ {
/** /**
* 入口跳转链接 * 入口跳转链接