Nuxt how to determine whether the current user has access to the index page, do not answer (such as token,session), do not answer irrelevant questions thank you.

mainly adds permission page control to the backend management system. For example, administrators can access all pages, while junior staff can only access some pages

.

the main problem is how to control the page in the middleware. In the vue set I currently use, I first write a permission.js, using midleware to compare whether the current user has the right to enter the page. If there is no permission, jump to 401. Is there a better way

this is a question of thinking, so I won"t post the code.

get down on your knees and beg your bosses for advice.


I don't know what a better way you're talking about. If you want to capture globally, solve it directly with middleware. If you only want to do this function on a specified page, just do it on the routing hook of that page

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bda2b4-2ff1f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bda2b4-2ff1f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?