简体   繁体   English

创建管理面板Mean.js

[英]Creating admin panel Mean.js

I'm using the stack mean.js for a customer. 我正在为客户使用堆栈mean.js。

I would like to create a community Web platform. 我想创建一个社区Web平台。 My customer would like he could seize things in the database. 我的客户希望他可以抓住数据库中的内容。 It is thus necessary that I created an admin panel only by himself. 因此,有必要仅由他自己创建一个管理面板。

I've saw that : how meanjs implement admin dashboard 我看到了: Meanjs如何实现管理仪表板

The First solution seems to suit but does not work with meanJs 4.0, generators are not any more even. 第一种解决方案似乎很适合,但不适用于MeanJs 4.0,生成器不再适用。 Somebody can he tell me how I can make to convert the solution on mean 4.0. 有人可以告诉我如何制作平均4.0的解决方案。 Or if it exist another solution. 或者,如果存在其他解决方案。

Thank you for any help or comment. 感谢您的帮助或评论。 Please excuse me for my bad English and have a nice day. 请原谅我英语不好,今天过得愉快。

I believe you are asking how to perform authentication with the MEAN stack. 我相信您在问如何对MEAN堆栈执行身份验证。 Which is a little bit vague for an SO question.. but maybe these links can help get you started. 对于SO问题来说这有点含糊。.但是也许这些链接可以帮助您入门。

Authentication would allow you to restrict access on certain views. 身份验证将允许您限制对某些视图的访问。 For example, only your client can access the administrator portal. 例如,只有您的客户端可以访问管理员门户。 Here are some basic guides on authentication with MEAN (though there are a lot more resource out there): 这是有关使用MEAN进行身份验证的一些基本指南(尽管那里有很多资源):

If you are using Express Routing this is pretty easy. 如果您使用的是快速路由,这非常简单。 Here is a very basic example on scotch.io: https://scotch.io/tutorials/route-middleware-to-check-if-a-user-is-authenticated-in-node-js 这是scotch.io上的一个非常基本的示例: https ://scotch.io/tutorials/route-middleware-to-check-if-a-user-is-authenticated-in-node-js

If you are doing a single page application (SPA) with Angular Routing: http://www.sitepoint.com/implementing-authentication-angular-applications/ 如果您正在使用Angular路由进行单页应用程序(SPA): http//www.sitepoint.com/implementing-authentication-angular-applications/

From the tags I assume you are using meanjs stack. 从标签中,我假设您正在使用meanjs堆栈。 You have to signup as user first. 您必须先以用户身份注册。 Then you need to access your mongodb database add the user role manually by adding "admin" to the roles of the user.Then you will we able to see the list of users which is part of the admin. 然后,您需要访问mongodb数据库,方法是在用户角色中添加“ admin”,从而手动添加用户角色。然后,我们将能够看到属于admin的用户列表。

As a beginner I would recommend using robomongo which has a nice UI to manipulate your database. 作为一个初学者,我建议使用robomongo ,它具有一个不错的UI来操作您的数据库。

The simplest way to get the list of users would be change the default role to "admin" 获取用户列表的最简单方法是将默认角色更改为“ admin”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM