publish 0.0.13
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>tiesheng-parent</artifactId>
|
||||
<version>0.0.12</version>
|
||||
<version>0.0.13</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>tiesheng-web</artifactId>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.tiesheng.core;
|
||||
|
||||
import com.tiesheng.core.service.TieshengWebConfigurer;
|
||||
import com.tiesheng.login.LoginAutoConfigurer;
|
||||
import com.tiesheng.message.MessageAutoConfigurer;
|
||||
import com.tiesheng.migration.MigrationAutoConfigurer;
|
||||
@@ -22,4 +23,7 @@ import java.lang.annotation.*;
|
||||
MigrationAutoConfigurer.class
|
||||
})
|
||||
public @interface EnableTieshengWeb {
|
||||
|
||||
Class<? extends TieshengWebConfigurer> webConfigurer();
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import cn.hutool.log.LogFactory;
|
||||
import com.tiesheng.core.pojos.CurrentWebUser;
|
||||
import com.tiesheng.core.pojos.dao.CorePlatformUnique;
|
||||
import com.tiesheng.login.config.token.bean.TokenBean;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import com.tiesheng.util.exception.ApiRespEnum;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
|
||||
@@ -51,19 +50,7 @@ public interface TieshengWebConfigurer {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
default LoginConfigurer loginConfigurer() {
|
||||
return new LoginConfigurer() {
|
||||
@Override
|
||||
public TokenBean doLogin(CorePlatformUnique platformUnique) {
|
||||
throw new ApiException("请配置TieshengWebConfigurer->loginConfigurer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void redirect(TokenBean bean, String extra, HttpServletResponse response) {
|
||||
throw new ApiException("请配置TieshengWebConfigurer->loginConfigurer");
|
||||
}
|
||||
};
|
||||
}
|
||||
LoginConfigurer loginConfigurer();
|
||||
|
||||
|
||||
interface LoginConfigurer {
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.tiesheng.core.service.impl;
|
||||
|
||||
import com.tiesheng.core.pojos.CurrentWebUser;
|
||||
import com.tiesheng.core.service.TieshengWebConfigurer;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnMissingBean(value = TieshengWebConfigurer.class, ignored = DefaultWebConfigurer.class)
|
||||
public class DefaultWebConfigurer implements TieshengWebConfigurer {
|
||||
|
||||
@Override
|
||||
public CurrentWebUser getCurrentUserName(String userId) {
|
||||
CurrentWebUser webUser = new CurrentWebUser();
|
||||
webUser.setId(userId);
|
||||
webUser.setName(webUser.getId());
|
||||
return webUser;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user