Skip to content

Commit ec702fe

Browse files
author
jianyan74
committed
修复后台权限个别情况下判断失效和增加插件商户映射字段说明
1 parent 4af26d7 commit ec702fe

File tree

4 files changed

+9
-113
lines changed

4 files changed

+9
-113
lines changed

common/models/common/Addons.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function rules()
5555
[['name', 'title', 'group', 'version', 'author'], 'required'],
5656
['name', 'match', 'pattern' => '/^[_a-zA-Z]+$/', 'message' => '标识由英文和下划线组成'],
5757
[
58-
['is_setting', 'is_rule', 'status', 'created_at', 'updated_at'],
58+
['is_setting', 'is_merchant_route_map', 'is_rule', 'status', 'created_at', 'updated_at'],
5959
'integer',
6060
],
6161
[['title', 'group', 'version'], 'string', 'max' => 20],
@@ -89,6 +89,7 @@ public function attributeLabels()
8989
'is_rule' => '嵌入规则',
9090
'is_setting' => '全局设置项',
9191
'is_mini_program' => 'Api/小程序',
92+
'is_merchant_route_map' => '商户映射',
9293
'bootstrap' => '启动',
9394
'console' => '控制台',
9495
'default_config' => '默认配置',

services/merchant/BankAccountService.php

Lines changed: 0 additions & 85 deletions
This file was deleted.

services/merchant/CommissionWithdrawService.php

Lines changed: 0 additions & 26 deletions
This file was deleted.

services/rbac/AuthRoleService.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use common\helpers\ArrayHelper;
1010
use common\helpers\TreeHelper;
1111
use common\models\rbac\AuthRole;
12+
use common\enums\AppEnum;
1213
use yii\web\UnauthorizedHttpException;
1314

1415
/**
@@ -45,11 +46,16 @@ public function getRole()
4546
throw new UnauthorizedHttpException('未授权角色,请联系管理员');
4647
}
4748

49+
$merchant_id = $this->getMerchantId();
50+
if (Yii::$app->id == AppEnum::BACKEND) {
51+
$merchant_id = '';
52+
}
53+
4854
$assignment = ArrayHelper::toArray($assignment);
4955
$this->roles = AuthRole::find()
5056
->where(['id' => $assignment['role_id']])
5157
->andWhere(['status' => StatusEnum::ENABLED])
52-
->andFilterWhere(['merchant_id' => $this->getMerchantId()])
58+
->andFilterWhere(['merchant_id' => $merchant_id])
5359
->asArray()
5460
->one();
5561

0 commit comments

Comments
 (0)