定制 crt0/lockpanel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

crt0/lockpanel

Composer 安装命令:

composer require crt0/lockpanel

包简介

Magento2 module to block administrative panel via API

README 文档

README

Descrição

O módulo CRT0\LockPanel foi criado para bloquear o painel administrativo do Magento por meio de endpoints da API REST. Ele permite:

  • Bloquear/desbloquear o acesso ao painel.
  • Verificar o status de bloqueio.
  • Configurar usuários que não serão afetados pelo bloqueio.

Instalação do Módulo

  1. Copie os arquivos do módulo para o diretório do Magento:

    app/code/CRT0/LockPanel

  2. Ative o módulo:

    bin/magento module:enable CRT0_LockPanel

  3. Atualize o sistema:

    bin/magento setup:upgrade && bin/magento setup:di:compile

    bin/magento c:c

  4. Pronto! O módulo está instalado.

Configuração

  1. No painel do Magento, vá para Stores > Configuration > CRT0 LockPanel.
  2. Configure:
    • Ativar o Módulo: Habilite o bloqueio administrativo.
    • Senha da API: Defina a senha para acessar os endpoints.
    • Usuários Isentos: Selecione usuários que poderão acessar o painel mesmo com o bloqueio.

Endpoints Disponíveis

1. Bloquear o Painel

  • Endpoint: POST /rest/V1/lockpanel/lock
  • Parâmetros (form data):
    • password (obrigatório): Senha configurada no painel.

Exemplo usando cURL:

bash

CopyEdit

curl -X POST "https://sualoja.com/rest/V1/lockpanel/lock" \ -H "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "password=minhasenhaapi"

2. Desbloquear o Painel

  • Endpoint: POST /rest/V1/lockpanel/unlock
  • Parâmetros (form data):
    • password (obrigatório): Senha configurada no painel.

Exemplo usando cURL:

bash

CopyEdit

curl -X POST "https://sualoja.com/rest/V1/lockpanel/unlock" \ -H "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "password=minhasenhaapi"

3. Consultar Status

  • Endpoint: GET /rest/V1/lockpanel/status

Exemplo usando cURL:

bash

CopyEdit

curl -X GET "https://sualoja.com/rest/V1/lockpanel/status" \ -H "Content-Type: application/json"

Resposta Possível:

  • Painel bloqueado:

    json

    CopyEdit

    { "status": "locked" }

  • Painel desbloqueado:

    json

    CopyEdit

    { "status": "unlocked" }

Description

The CRT0\LockPanel module was created to lock the Magento admin panel via REST API endpoints. It allows:

  • Lock/unlock access to the panel.
  • Check lock status.
  • Configure users who will not be affected by blocking.

Module Installation

  1. Copy the module files to the Magento directory:

    app/code/CRT0/LockPanel

  2. Activate the module:

    bin/magento module:enable CRT0_LockPanel

  3. Update the system:

    bin/magento setup:upgrade && bin/magento setup:di:compile

    bin/magento c:c

  4. Ready! The module is installed.

Settings

  1. In the Magento dashboard, go to Stores > Configuration > CRT0 LockPanel.
  2. Configure:
    • Activate the Module: Enable administrative blocking.
    • API Password: Set the password to access the endpoints.
    • Exempt Users: Select users who will be able to access the panel even if blocked.

Testes

  • Use ferramentas como Postman ou cURL para testar os endpoints.
  • Certifique-se de que os parâmetros da senha sejam enviados no formato form data para os métodos POST.

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-20