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

55 行
1.8 KiB
PHP
可执行文件

<?php
namespace Retail\Controller;
use Think\Controller;
use Think\Auth;
//[1.1.96]
class AloneBaseController extends EmptyController {
Public function _initialize() {
$jurisdiction_user = session('jurisdiction_user');
if (empty($jurisdiction_user)) {
if (IS_AJAX) {
$re['status'] = 0;
$re['state'] = 0;
$re['code'] = 0;
$re['count'] = 0;
$re['data'] = array();
$re['msg'] = '您无权操作';
$this->ajaxReturn($re);
} 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) {
//checkSite();//检测该域名是否可用
$this->checkwebset();
if (!session('guide_userinfo')) {
session(null);
echo '<script>top.window.location="'.$_SERVER ["SCRIPT_NAME"] .'/Retail/Login/index"</script>';
exit;
}
} else {
if (IS_AJAX) {
$re['status'] = 0;
$re['state'] = 0;
$re['code'] = 0;
$re['count'] = 0;
$re['data'] = array();
$re['msg'] = '您无权操作';
$this->ajaxReturn($re);
} else {
$this->diemsg(0,'您无权操作');
}
}
}
//禁止不动的失败提示的信息
public function diemsg($status, $msg)
{
//成功为1,失败为0
$this->error($msg);
die();
}
}