-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
defaultCtrl 的作用 #27
Comments
|
|
你是拿grace当MVC框架吗? |
grace作为前端框架 主要功能 就是路由+proxy; 典型的filter功能 就是在路由层控制的把? |
没明白你说的“典型的filter”的功能具体是什么功能呢?是指类似laravel的路由机制,某个路由才注入某个中间件? |
比如:spring中通过filter 限制未登录用户不能访问, 实现异常处理 等功能。 |
明白了。
如果有好的建议的话,可以提出来 |
目前我在使用过程中,做路由限制的方式如下 不知道是否有更合适的想法,现在的登陆是做到cookie中的(跳到第三方登陆界面,存放cookie)
|
@evanzlj 没怎么看明白问题,是说,是要实现登录用户的权限系统吗?这样的情况,可以让后端提供一个获取用户信息的接口;然后在defaultCtrl里直接调用接口,根据用户的情况进行判断。 另外,关于proxy看你上面写的有两个问题:
|
1.是用來當作filter使用嗎?
需要在每個controller的方法中 調用 yield bindDefault() , 不太方便。
2.以下這種寫法 調用不到 bindDefault() 方法。
exports.index_1 = async function () {
await this.bindDefault();
}
The text was updated successfully, but these errors were encountered: