alikhaleghi/basesys 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

alikhaleghi/basesys

最新稳定版本:v1.0.alpha

Composer 安装命令:

composer require alikhaleghi/basesys

包简介

Base System for Khaleghi Projects.

README 文档

README

Flexible, Powerful, Secure API package for CodeIgniter 4.

Project Notice

Things are supposed to work on CI4.2+

Requirements

  • PHP 8.1+
  • CodeIgniter 4.2+

Features

Authentication/Authorization

  • Login/Register/Account Recovery

  • User Panel -- Dashboard -- User Profile --- Account Details Modification --- Password Modification --- Contact Info Modification

  • Admin Panel -- Dashboard -- User Management --- User Modification --- User Group Management ---- User Group Add/Delete

Installation

Installation is best done via Composer. Assuming Composer is installed globally, you may use the following command:

    > composer require AliKhaleghi/BaseSys

This will add the latest stable release of AliKhaleghi/BaseSys as a module to your project.

Ensure your database is setup correctly, then run the Auth migrations:

    > php spark migrate -all  

Manual Labor

You will need to add some more configuration to get things working. Open or Create the file /app/config/Auth.php. In here we will need to add JSON Web Token library to Myth/Auth Authentication configuration. find the variable $authenticationLibs and add the following element to the array. 'jwt' => 'AliKhaleghi\BaseSys\Authentication\JWTAuthenticator', // JSON Web Token Authenticator Class /** * -------------------------------------------------------------------- * Libraries * -------------------------------------------------------------------- * * @var array */ public $authenticationLibs = [ 'local' => 'Myth\Auth\Authentication\LocalAuthenticator', 'jwt' => 'AliKhaleghi\BaseSys\Authentication\JWTAuthenticator', // JSON Web Token Authenticator Class ];

Filters

Please note that in order to keep the API End Points secure you will need to implant the following code to your App\Config\Filters.php

public array $filters = [
    'jwt_logged_in' => ['before' => ['api/client/*']],
    'jwt_admin' => ['before' => ['api/client/*']],
];

Registration Requirements

In order to get any sort of activation before allowing new users to log in, you will need tou update your App\Config\Auth.php configuration as follows:

/**
 * --------------------------------------------------------------------
 * Require Confirmation Registration via Email
 * --------------------------------------------------------------------
 *
 * When enabled, every registered user will receive an email message
 * with an activation link to confirm the account.
 *
 *  Validation Via Email: AliKhaleghi\BaseSys\Authentication\Activators\EmailActivator
 *  Validation Via SMS: AliKhaleghi\BaseSys\Authentication\Activators\SMSActivator
 *
 * @var string|null Name of the ActivatorInterface class
 */
public $requireActivation = 'AliKhaleghi\BaseSys\Authentication\Activators\EmailActivator';

if above value is not set yet registration requires activation, EmailActivator will be used as default.

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-08-12