Skip to content

Commit d130bcc

Browse files
authored
Merge pull request #22 from windhoney/develop
命名空间bug修复,路由列表注掉查询应用所有路由部分
2 parents 788412b + db25554 commit d130bcc

File tree

6 files changed

+16
-18
lines changed

6 files changed

+16
-18
lines changed

controllers/GroupsController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
* 用户分组
44
*/
55

6-
namespace work\modules\rbac\controllers;
6+
namespace wind\rest\controllers;
77

8-
use work\modules\rbac\controllers\base\ApiController;
9-
use work\modules\rbac\models\AuthGroups;
8+
use wind\rest\controllers\base\ApiController;
9+
use wind\rest\models\AuthGroups;
1010

1111
class GroupsController extends ApiController
1212
{
1313

1414
/**
15-
* @var \work\modules\rbac\models\AuthGroups
15+
* @var \wind\rest\models\AuthGroups
1616
*/
1717
public $group_model;
1818

controllers/UserController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace wind\rest\controllers;
44

55
use yii\helpers\ArrayHelper;
6-
use work\models\AdminUser;
76
use wind\rest\controllers\base\ApiController;
87
use Yii;
98
use wind\rest\models\form\Login;

models/AuthGroups.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?php
22

3-
namespace work\modules\rbac\models;
3+
namespace wind\rest\models;
44

5-
use work\modules\rbac\components\DbManager;
6-
use work\modules\rbac\components\Helper;
5+
use wind\rest\components\DbManager;
6+
use wind\rest\components\Helper;
77
use Yii;
88

99
/**
1010
* AuthGroups model
1111
*
1212
* @property string $group_name
1313
* @property string $group_id
14-
* @package work\modules\rbac\models
14+
* @package wind\rest\models
1515
*/
1616
class AuthGroups extends \yii\db\ActiveRecord
1717
{
@@ -130,7 +130,7 @@ public function assignUser()
130130
$assign = $group_child_model->assigned($this->id);
131131
$user_id_arr = array_filter(array_column($assign, 'id'));
132132
//all 所有
133-
$user_model = new \work\modules\rbac\models\searchs\User();
133+
$user_model = new \wind\rest\models\searchs\User();
134134
$all = $user_model->allUsers(['id', 'realname']);
135135
foreach ($all as $key => $val) {
136136
if (in_array($val['id'], $user_id_arr)) {

models/AuthGroupsChild.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?php
22

3-
namespace work\modules\rbac\models;
3+
namespace wind\rest\models;
44

5-
use work\modules\rbac\components\DbManager;
5+
use wind\rest\components\DbManager;
66

77
/**
88
* Class AuthGroups
99
*
1010
* @property string $user_id
1111
* @property string $group_id
12-
* @package work\modules\rbac\models
12+
* @package wind\rest\models
1313
*/
1414
class AuthGroupsChild extends \yii\db\ActiveRecord
1515
{

models/Route.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ public function remove($routes)
9696
public function getRoutes()
9797
{
9898
$manager = Yii::$app->getAuthManager();
99-
$routes = $this->getAppRoutes();
100-
// print_r($routes);die;
99+
// $routes = $this->getAppRoutes();
101100
$exists = [];
102101
foreach ($manager->getPermissions() as $name) {
103102
$name = ArrayHelper::toArray($name);
@@ -108,12 +107,12 @@ public function getRoutes()
108107
$route['description'] = $name['description'];
109108
$route['parent_name'] = $name['parent_name'];
110109
$exists[] = $route;
111-
unset($routes[$name['name']]);
110+
// unset($routes[$name['name']]);
112111
}
113112
$exists = ArrayHelper::index($exists, null, 'parent_name');
114113

115114
return [
116-
'avaliable' => array_keys($routes),
115+
// 'avaliable' => array_keys($routes),
117116
'assigned' => $exists
118117
];
119118
}

rule/BelongShopRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* 规则--用户所属店铺
44
*/
55

6-
namespace work\modules\rbac\rule;
6+
namespace wind\rest\rule;
77

88
use yii\rbac\Rule;
99
use yii;

0 commit comments

Comments
 (0)