如何在同一登录页面上定义管理员和客户? [英] How can I define admin and customer on same login page?

查看:89
本文介绍了如何在同一登录页面上定义管理员和客户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有管理员和客户的登录页面

我有两个数据库

我如何识别谁是客户谁是谁是管理员.... 。

Bcs都有不同的角色扮演

管理员应该有一个仪表板视图,客户只会聊聊电子邮件和querry。

如果我使用如果用于比较管理员和客户的ELSE声明它将正常工作。

请回复朋友。



我有什么尝试过:



我从我身边试过的一切

I Have a login page for both Admin And Customer
I have a database of both
How can i identify who is Customer and Who is Admin.....
Bcs both have Different Role to play
Admin should have a Dashboard View and customer will just chat email and querry.
If i use IF ELSE statement for comparing both Admin and Customer will it work without any problem.
Please reply friends.

What I have tried:

nothing i have tried from my side

推荐答案

你可以通过验证使用:



- 检查用户何时提供登录信息,在凭证验证期间,您可以返回用户类型,如管理员或客户

- 基于用户类型,您可以将用户重定向到特定页面。即对于Admin,您可以重定向到Admin / Manage,对于Customer,您可以重定向到Customer / Chat。

- 您还可以在每个控制器上使用Custom属性来提供特定访问权限。
You can validate by using:

- Check when user provide login information, during credential validation you can return user type like Admin or Customer
- Based on user type you can redirect user to specific page. i.e. for Admin you can redirect to Admin/Manage and for Customer you can redirect to Customer/Chat.
- You can also use Custom attribute on each controller to provide specific access.


这篇关于如何在同一登录页面上定义管理员和客户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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