Giter VIP home page Giter VIP logo

jackchow-rbac's Issues

Class 'think\facade\Env' not found

环境:

ThinkPHP 5.024 Apache PHP7.0 版本

使用 php think rbac:publish 生成 配置文件 config/rbac.php 失败~~~
查到原因发现是不支持 Loader::getRootPath() 的原因吧!

尝试手动拷贝 config/rbac.php ,但是不懂放置到哪里??????

================
我直接拷贝 rbac.php 放置在 application/config/rbac.php 请问这样子对吗?
先不论对错,我尝试使用 php think rbac:migrate 命令报错:

Class 'think\facade\Env' not found
这是什么原因呢?

underfined method think\Loader::getRootPath

发生这个问题的主要原因是thinkphp版本较低,tp5.1才有这个方法
解决方法有两种:
一:升级thinkphp版本
二:直接把rbac/src/config中的config.php文件改成rbac.php然后放到 config 文件夹就好,不用再输入 生成配置文件的命令了。

小建议

希望表里面默认有用户admin 角色为超级管理员
一般ID能为1 的 都是网站的超级管理员,可以避免逻辑,如果ID为1的话不管是什么都返回true或许挺不错的!

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.