Commit a927676a authored by 张晓林's avatar 张晓林

更新管理者权限

parent 5126de11
...@@ -319,6 +319,7 @@ return [ ...@@ -319,6 +319,7 @@ return [
'GET,OPTIONS manage-group-list' => 'manage-group-list', 'GET,OPTIONS manage-group-list' => 'manage-group-list',
'POST,OPTIONS manage-add' => 'manage-add', 'POST,OPTIONS manage-add' => 'manage-add',
'GET,OPTIONS get-user-info' => 'get-user-info', 'GET,OPTIONS get-user-info' => 'get-user-info',
'POST,OPTIONS manage-update' => 'manage-update',
], ],
], ],
], ],
......
...@@ -201,4 +201,40 @@ class ManageListController extends BaseController ...@@ -201,4 +201,40 @@ class ManageListController extends BaseController
return $userInfo; return $userInfo;
} }
/**
* @OA\POST(
* path="/backend/web/v1/authority/manage-lists/manage-update",
* tags={"权限管理"},
* summary="添加管理员(张晓林)",
* description="添加管理员",
* * @OA\RequestBody(
* required=true,
* @OA\MediaType(
* mediaType="application/x-www-form-urlencoded",
* @OA\Schema(
* type="object",
* @OA\Property(property="USER_ID",description="角色用户ID",type="string"),
* @OA\Property(property="ROLE_ID",description="选中的角色GUID",type="string"),
* )
* )
* ),
* @OA\Response(response=200,description="success"),
* security={{"Authorization": {}}}
* )
*/
public function actionManageUpdate(){
$param = Yii::$app->request->post();
$rbacRoleUserModel = new ShopRbacRoleUser();
$info = $rbacRoleUserModel::findOne(['USER_ID'=>$param['USER_ID']]);
$info->ROLE_ID = $param['ROLE_ID'];
if($info->save()){
return [
'code'=>200,
'message'=>'更新成功'
];
}else{
return $info->errors;
}
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment