mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-09 01:14:16 +08:00
优化权限配置
This commit is contained in:
@@ -90,6 +90,16 @@ public class AuthorizingHandlerAutoConfiguration {
|
||||
return new UserTokenAutoExpiredListener(userTokenManager);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AuthorizationController authorizationController() {
|
||||
return new AuthorizationController();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public UserTokenController userTokenController() {
|
||||
return new UserTokenController();
|
||||
}
|
||||
|
||||
@Configuration
|
||||
public static class DataAccessHandlerProcessor implements BeanPostProcessor {
|
||||
|
||||
|
||||
@@ -38,12 +38,13 @@ import org.springframework.context.annotation.Import;
|
||||
@ComponentScan({"org.hswebframework.web.service.authorization.simple"
|
||||
, "org.hswebframework.web.authorization.controller"})
|
||||
@MapperScan("org.hswebframework.web.authorization.dao")
|
||||
@AutoConfigureBefore(DefaultAuthorizationAutoConfiguration.class)
|
||||
@AutoConfigureBefore(value = {
|
||||
DefaultAuthorizationAutoConfiguration.class
|
||||
}, name = "org.hswebframework.web.authorization.basic.configuration.AuthorizingHandlerAutoConfiguration")
|
||||
@Import(BasicAuthorizationConfiguration.class)
|
||||
public class AuthorizationAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(AuthenticationManager.class)
|
||||
public AuthenticationManager authenticationManager(AuthenticationInitializeService authenticationInitializeService) {
|
||||
return new SimpleAuthenticationManager(authenticationInitializeService);
|
||||
}
|
||||
|
||||
@@ -18,21 +18,23 @@
|
||||
package org.hswebframework.web.authorization.starter;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.hswebframework.web.authorization.basic.configuration.EnableAopAuthorize;
|
||||
import org.hswebframework.web.entity.authorization.UserEntity;
|
||||
import org.hswebframework.web.service.authorization.UserService;
|
||||
import org.hswebframework.web.tests.SimpleWebApplicationTests;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.MediaType;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* TODO 完成注释
|
||||
*
|
||||
* @author zhouhao
|
||||
*/
|
||||
@Configuration
|
||||
@EnableAopAuthorize
|
||||
public class LoginTests extends SimpleWebApplicationTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
Reference in New Issue
Block a user