first commit

This commit is contained in:
编码猿
2024-09-27 01:32:49 +08:00
commit 28ebe05a64
7399 changed files with 1174529 additions and 0 deletions

View File

@@ -0,0 +1 @@
1eb648ed-2bbc-4809-ab98-4ea3f0e5a335

View File

@@ -0,0 +1,19 @@
<?php
namespace app\common\behavior;
use think\Container;
use think\facade\Config;
use think\facade\Request;
use think\facade\Route;
class SetModule
{
public function run($params)
{
$url="http://".$_SERVER ['HTTP_HOST'].$_SERVER['PHP_SELF'];
preg_match("#http://(.*?)\.#i",$url,$match);
if($match[1] != 'api'){
Route::bind(Config::get('app.default_module'));
}
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace app\common\behavior;
use think\facade\Config;
use think\facade\Cookie;
use think\facade\Request;
class SetSessionDomain
{
public function run($params)
{
// 行为逻辑
$httphost=Request::server('HTTP_HOST');
Config::set('WEB_ACCESS_CONFIG',Config::get('access.WEB_ACCESS_CONFIG'));
foreach (Config::get('access.SPECIAL_WEB_ACCESS_CONFIG') as $k=>$v) {
if (strpos($httphost,$k)!==false) {
Config::set('WEB_ACCESS_CONFIG',$v);
}
}
ini_set('session.cookie_domain', Config::get('WEB_ACCESS_CONFIG')['SESSION_DOMAIN']);
//将cookie的域重新设定
Config::set('cookie.domain',Config::get('WEB_ACCESS_CONFIG')['SESSION_DOMAIN']);
//Cookie::init(['domain'=>Config::get('WEB_ACCESS_CONFIG')['SESSION_DOMAIN']]);
// 行为逻辑
//ini_set('session.cookie_domain', Config::get('access.SESSION_DOMAIN'));
}
}