谁给一个thinkphp auth 的实例

谁给一个thinkphp auth 的实例
2025-05-08 23:01:56
推荐回答(2个)
回答1:

创建一个对象时程序会合并配置信息
程序会合并Application\Common\Conf\config.php中的AUTH_CONFIG数组
public function __construct() {
$prefix = C('DB_PREFIX');
$this->_config['AUTH_GROUP'] = $prefix . $this->_config['AUTH_GROUP'];
$this->_config['AUTH_RULE'] = $prefix . $this->_config['AUTH_RULE'];
$this->_config['AUTH_USER'] = $prefix . $this->_config['AUTH_USER'];
$this->_config['AUTH_GROUP_ACCESS'] = $prefix . $this->_config['AUTH_GROUP_ACCESS'];
if (C('AUTH_CONFIG')) {
//可设置配置项 AUTH_CONFIG, 此配置项为数组。
$this->_config = array_merge($this->_config, C('AUTH_CONFIG'));
}
}

回答2:

我这有,加上我告诉你1284537680