有没有办法禁用starpi中的管理页面? [英] Is there any way to disable a admin page in starpi?

查看:57
本文介绍了有没有办法禁用starpi中的管理页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的一个项目中使用了 Strapi 框架.开发后,我需要禁用管理仪表板('/admin' 路由).我找到了更改 URL 的方法,但不能禁用.我该怎么做?

I am using strapi framework in one of my project. After development, I need to disable the admin dashboard ('/admin' route). I found the ways to change the URL, but not to disable. How can i do this?

推荐答案

在生产环境中没有禁用管理员的选项.

There is no option to disable the admin in production.

您可以使用 _admin 重命名 admin 文件夹(或删除文件夹)更新 plugin/users-permissions/middlewares/users-permissions/index.js 文件并注释以下几行:

You can rename the admin folder with _admin (or delete the folder) Update the plugin/users-permissions/middlewares/users-permissions/index.js file and comment these lines:

// _.forEach(strapi.admin.config.routes, value => {
//   if (_.get(value.config, 'policies')) {
//     value.config.policies.unshift('plugins.users-permissions.permissions');
//   }
// });

然后您将无法访问管理面板

Then you will not be able to access to the admin pannel

这篇关于有没有办法禁用starpi中的管理页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆