如何使用Parse登录的用户可以查看网页?

时间:2021-07-12 15:22:20

I've built a homepage where users can login/register using parseSDK. That works at the moment. The second page I've made is a dashboard (dashboard.html) which should be viewable to only users that login. At the moment, anyone can do ... http://mywebsite.com/dashboard.html and see the webpage.

我已经构建了一个主页,用户可以使用parseSDK登录/注册。那是有效的。我做的第二个页面是一个仪表板(dashboard.html),只有登录的用户才能查看。目前,任何人都可以... http://mywebsite.com/dashboard.html并查看网页。

How can I set it up in such a way such that every time an user (not logged in at the time) goes to that URL, it will take them to index.html to login?

如何以这样的方式进行设置,以便每次用户(当时未登录)进入该URL时,都会将他们带到index.html进行登录?

1 个解决方案

#1


0  

Check for Parse.User.current() in your javascript code. This gives you the details of current logged in user. You can redirect to index.html or dashboard.html accordingly.

在javascript代码中检查Parse.User.current()。这将为您提供当前登录用户的详细信息。您可以相应地重定向到index.html或dashboard.html。

#1


0  

Check for Parse.User.current() in your javascript code. This gives you the details of current logged in user. You can redirect to index.html or dashboard.html accordingly.

在javascript代码中检查Parse.User.current()。这将为您提供当前登录用户的详细信息。您可以相应地重定向到index.html或dashboard.html。