Skip to content
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

很好奇 #2

Closed
cgnq opened this issue Dec 14, 2017 · 4 comments
Closed

很好奇 #2

cgnq opened this issue Dec 14, 2017 · 4 comments

Comments

@cgnq
Copy link

cgnq commented Dec 14, 2017

MyShiroRealm 是通过new出来的,那么调用这个类时候,里面的adminUserService是怎么注入进来的呢

@ChinaLHR
Copy link
Owner

@cgnq 在使用@configuration注解的配置类中,@bean注解会告诉Spring这个方法将会返回一个对象, 该对象要注册为Spring应用上下文中的bean。 方法体中包含了最终产生bean实例的逻辑。

By Spring In Action

@cgnq
Copy link
Author

cgnq commented Dec 15, 2017

这样,另外请教一个问题,我用了你的shiro的配置,登录还有登出也是用你的controller,后台UI用的layui,但每第一次登录都会不成功,页面刷新一下,还在登录页面。
image
login方法是200但是没有跳转

@ChinaLHR
Copy link
Owner

@cgnq 这个应该是登录成功后shiro会去session中找出之前的保存的请求进行跳转,如果没有保存才会跳转到配置的successUrl导致的,有时间我再去修复一下

@cgnq
Copy link
Author

cgnq commented Dec 15, 2017

@ChinaLHR 感谢回复,这个问题我找到了,是前端用ajax异步请求,后端未返回,导致前端js直接返回false造成的,框架非常不错。持续关注

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants