新增cookie和uuid方法

This commit is contained in:
gongfuxiang 2021-11-01 13:43:37 +08:00
parent 3180f6595f
commit cbc0783f52
3 changed files with 38 additions and 7 deletions

View File

@ -60,6 +60,21 @@ function MySession($name = '', $value = '')
return session($name, $value);
}
/**
* cookie管理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-07-17
* @desc description
* @param [string] $name [cookie名称]
* @param [mixed] $value [cookie值]
*/
function MyCookie($name = '', $value = '')
{
return cookie($name, $value);
}
/**
* 缓存管理
* @author Devil

View File

@ -138,12 +138,6 @@ class Common extends BaseController
{
// 配置信息初始化
ConfigService::ConfigInit();
// 推荐人
if(!empty($this->data_request['referrer']))
{
MySession('share_referrer_id', $this->data_request['referrer']);
}
}
/**

View File

@ -31,7 +31,10 @@ class SystemService
public static function SystemBegin($params = [])
{
// 当前用户生成uuid并存储
self::SetUserUUId();
self::SetUserUUId($params);
// 分享标识处理
self::SetShareReferrer($params);
// 钩子
$hook_name = 'plugins_service_system_begin';
@ -61,6 +64,25 @@ class SystemService
]);
}
/**
* 分享标识处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-03-18
* @desc description
* @param [array] $params [输入参数]
*/
public static function SetShareReferrer($params = [])
{
// 推荐人
if(!empty($params['referrer']))
{
MySession('share_referrer_id', $params['referrer']);
cookie('share_referrer_id', $params['referrer']);
}
}
/**
* 当前用户生成uuid并存储
* @author Devil