init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)
这个提交包含在:
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace Agent\Controller;
|
||||
|
||||
use Think\Controller;
|
||||
use Think\Auth;
|
||||
|
||||
//[1.8.50]
|
||||
class BaseController extends EmptyController
|
||||
{
|
||||
protected $agent_id;//代理商ID
|
||||
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('agent_userinfo')) {
|
||||
session(null);
|
||||
echo '<script>top.window.location="' . $_SERVER ["SCRIPT_NAME"] . '/Retail/Login/index"</script>';
|
||||
exit;
|
||||
}
|
||||
$this->agent_id = $jurisdiction_user['agent_id'];
|
||||
$this->partner_id = session('agent_userinfo')['partnerid'];
|
||||
} 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();
|
||||
}
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户