Comments (4)
搞定了,config中components中"authManager" 之前写的是\yii\rbac\DbManager 应该指向你的DbManager 啊,水平太菜了,请见谅。
from yii2-rest-rbac.
文档中漏掉了,这个字段后加的
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.
我现在在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.
因为需要做一些修改,在使用该组件时,没有有composer引入,而是把文件单独引入的,这样的话就涉及到一个namespace的问题,因为namespace不一样,是不是还需要修改所有的namespace
from yii2-rest-rbac.
Related Issues (10)
- 关于代码parent_name HOT 1
- 前后端分离后,如何控制同一个路由页面中不同角色显示不同的页面元素 HOT 4
- 前后端分离,如何实现树形多级权限分组显示 HOT 2
- 求demo HOT 2
- composer.json没有PHP版本的信息 HOT 1
- models/Menu里的表名hard code问题 HOT 4
- models/serachs/User.php里的filedlist多了一个字段role HOT 1
- wind\rest\components\Configs HOT 7
- 生成不了oauth2表问题
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-rest-rbac.