Git Product home page Git Product logo

common's Introduction

公共的一些内容

安装

composer require ece2/common -W --ignore-platform-reqs

初始化, 仅仅用在刚刚创建的 hyperf 项目, 不然会覆盖项目代码

php bin/hyperf.php vendor:publish ece2/common -f

如果本地调试公共组件的话, 可以在 composer.json 里加入一下代码, 以及 url 按照本地目录有对应的公共组件项目代码, 然后 composer update

"repositories": {
    "ece2/common": {
        "type": "path",
        "url": "../common"
    }
}

增加的 command

按照数据表生成对应 model service controller 文件

php bin/hyperf.php gen:code --with-comments --refresh-fillable {表名}

用户身份传递

  • (Http 相关) 鉴权走的 src/Aspect/AuthAspect, 根据注解 Auth($guard) 对应的 AuthAspect 里的 AuthenticationInterface 对应实现来 check token
  • (RPC 相关) src/Aspect/JsonRpcIdTransferAspect 注入 RPC 请求前, 把当前 Http 写入上下文的用户信息写入 RPC 上下文
  • (RPC 相关) src/Middleware/JsonRpcIdTransferMiddleware 接收到 RPC 请求, 从 RPC 请求上下文获取用户信息

common's People

Contributors

ece2 avatar tom258 avatar carltomcat avatar

Stargazers

Giles Harrison avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.