文件
mashangyoujiu/Application/Admin/Controller/BaseController.class.php

66 行
1.9 KiB
PHP
可执行文件

<?php
namespace Admin\Controller;
use Think\Controller;
use Think\Auth;
//[1.8.50]
class BaseController extends EmptyController
{
protected $partner_id;//合伙人ID
protected $login_user; //登录的用户信息
Public function _initialize()
{
$jurisdiction_user = session('jurisdiction_user');
if (empty($jurisdiction_user)) {
if (IS_POST) {
$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('admin_userinfo')) {
session(null);
echo '<script>top.window.location="' . $_SERVER ["SCRIPT_NAME"] . '/Retail/Login/index"</script>';
exit;
}
$this->partner_id = $jurisdiction_user['partner_id'];
} else {
if (IS_POST) {
$re['status'] = 0;
$re['state'] = 0;
$re['code'] = 0;
$re['count'] = 0;
$re['data'] = array();
$re['msg'] = '您无权操作';
$this->ajaxReturn($re);
} else {
$this->diemsg(0, '您无权操作');
}
}
$this->login_user = $jurisdiction_user;
}
//禁止不动的失败提示的信息
public function diemsg($status, $msg)
{
//成功为1,失败为0
$this->error($msg);
die();
}
}