我必须做一个应用程序,其中一部分用户管理他们的所有事情,另一部分管理员,这里是我的问题:
一个有react经验的人告诉我,如果admin是自己,最好把administrator和用户的app分开,不然会很重(不知道是不是慢)。
但是想一想,我是管理员,但我与用户有共同的组件,我更喜欢两者都有一个应用程序。
这非常贵?或者我可以将我的管理面板与登录/注册和用户前端一起做吗?
最佳答案
任何一个选项都可以工作,如果操作正确 .一般来说,我更喜欢使用同一个应用程序,因为它更易于维护,特别是如果两个应用程序共享许多公共(public)代码时。但是,有一些考虑可能会使天平有利于两种不同的应用,主要是:
1. It is easier to lock down a separate HR application to more than
simply a login role.For example, the Employee app may be publicly
accessible via the
internet, but the HR app could be locked down to the internal
network, or even certain user's workstations.
2. It would be much harder to brute force a valid login for the HR
app without having access to it.
3. With a single app, it is possible for a developer to make a
mistake and accidentally expose admin functionality to regular
users.
This obviously would not happen with separate apps. (This is why
stressed "if done correctly" in the first sentence.)
关于reactjs - 用户和管理员在同一个应用程序中或分开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56105300/