文件
mashangyoujiu/Application/Retail/Controller/NewBaseController.class.php

34 行
975 B
PHP
可执行文件

<?php
namespace Retail\Controller;
use Think\Controller;
use Think\Auth;
//[1.7.90]
class NewBaseController extends EmptyController
{
Public function _initialize()
{
$jurisdiction_user = session('jurisdiction_user');
if (empty($jurisdiction_user)) {
if (IS_POST) {
$this->ajaxReturn(['status' => 0, 'count' => 0, 'data' => [], 'msg' => '登录超时']);
} else {
session(null);
echo '<script>top.window.location="' . $_SERVER ["SCRIPT_NAME"] . '/Retail/Login/index"</script>';
exit;
}
}
$Auth = new Auth;
$res = $Auth->check($jurisdiction_user['id']);
if (!$res) {
if (IS_POST) {
$this->ajaxReturn(['status' => 0, 'count' => 0, 'data' => [], 'msg' => '您无权操作',]);
} else {
echo '您无权操作';
die();
}
}
}
}