Giter Site home page Giter Site logo

Comments (4)

wayne798 avatar wayne798 commented on August 19, 2024 1

搞定了,config中components中"authManager" 之前写的是\yii\rbac\DbManager 应该指向你的DbManager 啊,水平太菜了,请见谅。

from yii2-rest-rbac.

windhoney avatar windhoney commented on August 19, 2024

文档中漏掉了,这个字段后加的
CREATE TABLE auth_item (
name varchar(64) COLLATE utf8_unicode_ci NOT NULL,
type int(11) NOT NULL,
description text COLLATE utf8_unicode_ci,
rule_name varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
parent_name varchar(30) COLLATE utf8_unicode_ci DEFAULT '' COMMENT '父级名称',
data text COLLATE utf8_unicode_ci,
created_at int(11) DEFAULT NULL,
updated_at int(11) DEFAULT NULL,
PRIMARY KEY (name),
KEY rule_name (rule_name) USING BTREE,
KEY idx-auth_item-type (type) USING BTREE,
KEY parent_name (parent_name),
CONSTRAINT auth_item_ibfk_1 FOREIGN KEY (rule_name) REFERENCES auth_rule (name) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

from yii2-rest-rbac.

wayne798 avatar wayne798 commented on August 19, 2024

我现在在auth_item表中添加了parent_name字段,但是我在获取路由列表时提示如下错误

"name": "PHP Notice",
 "message": "Undefined index: parent_name",
"file": "/Applications/XAMPP/xamppfiles/htdocs/api-yii/Source/api/modules/rbac/models/Route.php",
  "line": 109,

也就是上面getRoutes函数中的这个代码

$route['parent_name'] = $name['parent_name'];

请问还需要其他配置么?

from yii2-rest-rbac.

wayne798 avatar wayne798 commented on August 19, 2024

因为需要做一些修改,在使用该组件时,没有有composer引入,而是把文件单独引入的,这样的话就涉及到一个namespace的问题,因为namespace不一样,是不是还需要修改所有的namespace

from yii2-rest-rbac.

Related Issues (10)

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.