应用中心单点登录
This commit is contained in:
parent
c04e805f7a
commit
cba477a24d
76
api/pom.xml
Normal file
76
api/pom.xml
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.lktx.center</groupId>
|
||||||
|
<artifactId>app-center</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>api</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<!-- 核心依赖-->
|
||||||
|
<dependency>
|
||||||
|
<artifactId>hserver</artifactId>
|
||||||
|
<groupId>cn.hserver</groupId>
|
||||||
|
</dependency>
|
||||||
|
<!-- web框架 -->
|
||||||
|
<dependency>
|
||||||
|
<artifactId>hserver-plugin-web</artifactId>
|
||||||
|
<groupId>cn.hserver</groupId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<artifactId>hserver-plugin-forest</artifactId>
|
||||||
|
<groupId>cn.hserver</groupId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<artifactId>hserver-plugin-satoken</artifactId>
|
||||||
|
<groupId>cn.hserver</groupId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>me.zhyd.oauth</groupId>
|
||||||
|
<artifactId>JustAuth</artifactId>
|
||||||
|
<version>1.16.7</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.18.30</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-all</artifactId>
|
||||||
|
<version>5.8.25</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>RELEASE</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>hserver-plugin-maven</artifactId>
|
||||||
|
<groupId>cn.hserver</groupId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
61
pom.xml
61
pom.xml
@ -7,6 +7,11 @@
|
|||||||
<groupId>com.lktx.center</groupId>
|
<groupId>com.lktx.center</groupId>
|
||||||
<artifactId>app-center</artifactId>
|
<artifactId>app-center</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<modules>
|
||||||
|
<module>api</module>
|
||||||
|
<module>web</module>
|
||||||
|
</modules>
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>hserver-parent</artifactId>
|
<artifactId>hserver-parent</artifactId>
|
||||||
<groupId>cn.hserver</groupId>
|
<groupId>cn.hserver</groupId>
|
||||||
@ -20,62 +25,6 @@
|
|||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<!-- 核心依赖-->
|
|
||||||
<dependency>
|
|
||||||
<artifactId>hserver</artifactId>
|
|
||||||
<groupId>cn.hserver</groupId>
|
|
||||||
</dependency>
|
|
||||||
<!-- web框架 -->
|
|
||||||
<dependency>
|
|
||||||
<artifactId>hserver-plugin-web</artifactId>
|
|
||||||
<groupId>cn.hserver</groupId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<artifactId>hserver-plugin-forest</artifactId>
|
|
||||||
<groupId>cn.hserver</groupId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<artifactId>hserver-plugin-satoken</artifactId>
|
|
||||||
<groupId>cn.hserver</groupId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>me.zhyd.oauth</groupId>
|
|
||||||
<artifactId>JustAuth</artifactId>
|
|
||||||
<version>1.16.7</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
<version>1.18.30</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.hutool</groupId>
|
|
||||||
<artifactId>hutool-all</artifactId>
|
|
||||||
<version>5.8.25</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
<version>RELEASE</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>hserver-plugin-maven</artifactId>
|
|
||||||
<groupId>cn.hserver</groupId>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
@ -1,36 +0,0 @@
|
|||||||
package com.lktx.center.config;
|
|
||||||
|
|
||||||
import cn.hserver.core.ioc.annotation.Bean;
|
|
||||||
import cn.hserver.core.ioc.annotation.Configuration;
|
|
||||||
import cn.hserver.core.ioc.annotation.Value;
|
|
||||||
import me.zhyd.oauth.config.AuthConfig;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
public class AuthRequestConfig {
|
|
||||||
|
|
||||||
@Value("oauth.clientId")
|
|
||||||
private String clientId;
|
|
||||||
|
|
||||||
@Value("oauth.clientSecret")
|
|
||||||
private String clientSecret;
|
|
||||||
|
|
||||||
@Value("oauth.redirectUri")
|
|
||||||
private String redirectUri;
|
|
||||||
|
|
||||||
@Value("oauth.url")
|
|
||||||
private String url;
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public SsoAuthRequest getAuthRequest() {
|
|
||||||
return new SsoAuthRequest(AuthConfig.builder()
|
|
||||||
.clientId(clientId)
|
|
||||||
.clientSecret(clientSecret)
|
|
||||||
.redirectUri(redirectUri)
|
|
||||||
//其他系统可以不要center
|
|
||||||
.scopes(List.of("userinfo", "center"))
|
|
||||||
.build(),new SsoSource(url));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
package com.lktx.center.config;
|
|
||||||
|
|
||||||
|
|
||||||
public interface Data {
|
|
||||||
String AuthToken = "AuthToken";
|
|
||||||
}
|
|
||||||
@ -1,128 +0,0 @@
|
|||||||
package com.lktx.center.config;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.lktx.center.domain.vo.SsoUserAppVO;
|
|
||||||
import me.zhyd.oauth.cache.AuthStateCache;
|
|
||||||
import me.zhyd.oauth.config.AuthConfig;
|
|
||||||
import me.zhyd.oauth.enums.AuthResponseStatus;
|
|
||||||
import me.zhyd.oauth.enums.AuthUserGender;
|
|
||||||
import me.zhyd.oauth.exception.AuthException;
|
|
||||||
import me.zhyd.oauth.model.AuthCallback;
|
|
||||||
import me.zhyd.oauth.model.AuthResponse;
|
|
||||||
import me.zhyd.oauth.model.AuthToken;
|
|
||||||
import me.zhyd.oauth.model.AuthUser;
|
|
||||||
import me.zhyd.oauth.request.AuthDefaultRequest;
|
|
||||||
import me.zhyd.oauth.utils.*;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
|
|
||||||
public class SsoAuthRequest extends AuthDefaultRequest {
|
|
||||||
|
|
||||||
private final SsoSource source;
|
|
||||||
|
|
||||||
public SsoAuthRequest(AuthConfig config,SsoSource source) {
|
|
||||||
super(config, source);
|
|
||||||
this.source=source;
|
|
||||||
}
|
|
||||||
|
|
||||||
private AuthToken getAuthToken(JSONObject object) {
|
|
||||||
this.checkResponse(object);
|
|
||||||
return AuthToken.builder().accessToken(object.getString("access_token")).expireIn(object.getIntValue("expires_in")).tokenType(object.getString("token_type")).idToken(object.getString("id_token")).refreshToken(object.getString("refresh_token")).uid(object.getString("userId")).openId(object.getString("userId")).build();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void checkResponse(JSONObject object) {
|
|
||||||
if (object.containsKey("error")) {
|
|
||||||
throw new AuthException(object.getString("error_description"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected String revokeUrl(AuthToken authToken) {
|
|
||||||
return UrlBuilder.fromBaseUrl(source.revoke())
|
|
||||||
.queryParam("access_token", authToken.getAccessToken())
|
|
||||||
.queryParam("client_id", this.config.getClientId())
|
|
||||||
.queryParam("client_secret", this.config.getClientSecret())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String authorize(String state) {
|
|
||||||
return UrlBuilder.fromBaseUrl(source.authorize()).queryParam("response_type", "code").queryParam("client_id", this.config.getClientId()).queryParam("redirect_uri", this.config.getRedirectUri()).queryParam("scope", String.join(",",this.config.getScopes())).queryParam("state", this.getRealState(state)).build();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public AuthToken getAccessToken(AuthCallback authCallback) {
|
|
||||||
return AuthToken.builder().accessCode(authCallback.getCode()).build();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public AuthUser getUserInfo(AuthToken authToken) {
|
|
||||||
String response = this.doPostAuthorizationCode(authToken.getAccessCode());
|
|
||||||
JSONObject accessTokenObject = JSONObject.parseObject(response);
|
|
||||||
if (accessTokenObject.getIntValue("code") != 200) {
|
|
||||||
throw new AuthException(accessTokenObject.getString("mssg"));
|
|
||||||
} else {
|
|
||||||
authToken = this.getAuthToken(accessTokenObject);
|
|
||||||
return AuthUser.builder().rawUserInfo(accessTokenObject)
|
|
||||||
.uuid(StringUtils.isEmpty(authToken.getUid()) ? authToken.getOpenId() : authToken.getUid())
|
|
||||||
.username(accessTokenObject.getString("username")).nickname(accessTokenObject.getString("nickname"))
|
|
||||||
.avatar(accessTokenObject.getString("avatar"))
|
|
||||||
.email(accessTokenObject.getString("email"))
|
|
||||||
.gender(AuthUserGender.UNKNOWN)
|
|
||||||
.token(authToken)
|
|
||||||
.source(source.toString())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public AuthResponse<AuthToken> refresh(AuthToken oldToken) {
|
|
||||||
String tokenUrl = this.refreshTokenUrl(oldToken.getRefreshToken());
|
|
||||||
String response = (new HttpUtils(this.config.getHttpConfig())).post(tokenUrl).getBody();
|
|
||||||
JSONObject accessTokenObject = JSONObject.parseObject(response);
|
|
||||||
AuthResponse<AuthToken> authTokenAuthResponse = new AuthResponse<>();
|
|
||||||
if (accessTokenObject.getIntValue("code") == 200) {
|
|
||||||
authTokenAuthResponse.setCode(AuthResponseStatus.SUCCESS.getCode());
|
|
||||||
authTokenAuthResponse.setData(this.getAuthToken(accessTokenObject));
|
|
||||||
}else {
|
|
||||||
authTokenAuthResponse.setCode(AuthResponseStatus.FAILURE.getCode());
|
|
||||||
authTokenAuthResponse.setMsg(accessTokenObject.getString("msg"));
|
|
||||||
}
|
|
||||||
|
|
||||||
return authTokenAuthResponse;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public AuthResponse<Void> revoke(AuthToken authToken) {
|
|
||||||
String tokenUrl = this.revokeUrl(authToken);
|
|
||||||
String response = (new HttpUtils(this.config.getHttpConfig())).post(tokenUrl).getBody();
|
|
||||||
JSONObject accessTokenObject = JSONObject.parseObject(response);
|
|
||||||
AuthResponse<Void> authTokenAuthResponse = new AuthResponse<>();
|
|
||||||
authTokenAuthResponse.setMsg(accessTokenObject.getString("msg"));
|
|
||||||
if (accessTokenObject.getIntValue("code") == 200) {
|
|
||||||
authTokenAuthResponse.setCode(AuthResponseStatus.SUCCESS.getCode());
|
|
||||||
}else {
|
|
||||||
authTokenAuthResponse.setCode(AuthResponseStatus.FAILURE.getCode());
|
|
||||||
}
|
|
||||||
return authTokenAuthResponse;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public AuthResponse<SsoUserAppVO> center(AuthToken authToken) {
|
|
||||||
String response = (new HttpUtils(this.config.getHttpConfig())).post(source.center(),Map.of("access_token",authToken.getAccessToken()),true).getBody();
|
|
||||||
JSONObject accessTokenObject = JSONObject.parseObject(response);
|
|
||||||
AuthResponse<SsoUserAppVO> authTokenAuthResponse = new AuthResponse<>();
|
|
||||||
authTokenAuthResponse.setMsg(accessTokenObject.getString("msg"));
|
|
||||||
if (accessTokenObject.getIntValue("code") == 200) {
|
|
||||||
authTokenAuthResponse.setCode(AuthResponseStatus.SUCCESS.getCode());
|
|
||||||
authTokenAuthResponse.setData(accessTokenObject.getObject("data", SsoUserAppVO.class));
|
|
||||||
}else {
|
|
||||||
authTokenAuthResponse.setCode(AuthResponseStatus.FAILURE.getCode());
|
|
||||||
}
|
|
||||||
return authTokenAuthResponse;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
package com.lktx.center.config;
|
|
||||||
|
|
||||||
import me.zhyd.oauth.config.AuthSource;
|
|
||||||
import me.zhyd.oauth.request.AuthDefaultRequest;
|
|
||||||
|
|
||||||
public class SsoSource implements AuthSource {
|
|
||||||
|
|
||||||
private final String baseUrl;
|
|
||||||
|
|
||||||
public SsoSource(String baseUrl) {
|
|
||||||
this.baseUrl = baseUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String authorize() {
|
|
||||||
return baseUrl+"oauth2/authorize";
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String accessToken() {
|
|
||||||
return baseUrl+"oauth2/token";
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String userInfo() {
|
|
||||||
return baseUrl+"oauth2/userinfo";
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String refresh() {
|
|
||||||
return baseUrl+"oauth2/refresh";
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String revoke() {
|
|
||||||
return baseUrl+"oauth2/revoke";
|
|
||||||
}
|
|
||||||
|
|
||||||
public String center(){
|
|
||||||
return baseUrl+"oauth2/center";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Class<? extends AuthDefaultRequest> getTargetClass() {
|
|
||||||
return SsoAuthRequest.class;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,70 +0,0 @@
|
|||||||
package com.lktx.center.controller;
|
|
||||||
|
|
||||||
import cn.dev33.satoken.session.SaSession;
|
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
|
||||||
import cn.hserver.core.ioc.annotation.Autowired;
|
|
||||||
import cn.hserver.plugin.web.annotation.Controller;
|
|
||||||
import cn.hserver.plugin.web.annotation.GET;
|
|
||||||
import cn.hserver.plugin.web.interfaces.HttpResponse;
|
|
||||||
import cn.hutool.json.JSONUtil;
|
|
||||||
import com.lktx.center.config.Data;
|
|
||||||
import com.lktx.center.config.SsoAuthRequest;
|
|
||||||
import com.lktx.center.domain.bean.SsoApp;
|
|
||||||
import com.lktx.center.domain.vo.SsoUserAppVO;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import me.zhyd.oauth.model.AuthResponse;
|
|
||||||
import me.zhyd.oauth.model.AuthToken;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
@Slf4j
|
|
||||||
@Controller
|
|
||||||
public class HomeController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SsoAuthRequest authRequest;
|
|
||||||
|
|
||||||
@GET("/")
|
|
||||||
public void index(HttpResponse response) {
|
|
||||||
if (StpUtil.isLogin()){
|
|
||||||
try {
|
|
||||||
SaSession session = StpUtil.getSession();
|
|
||||||
AuthToken authToken = session.get(Data.AuthToken,null);
|
|
||||||
if (authToken != null){
|
|
||||||
AuthResponse<SsoUserAppVO> center = authRequest.center(authToken);
|
|
||||||
if (center.ok()) {
|
|
||||||
Map<String, Object> data = Map.of(
|
|
||||||
"user", center.getData().getSsoUser(),
|
|
||||||
"appList", center.getData().getSsoAppList(),
|
|
||||||
"appGroup", center.getData().getSsoAppList().stream().map(SsoApp::getSsoAppGroup).collect(Collectors.toSet())
|
|
||||||
);
|
|
||||||
response.sendTemplate("index.ftl",data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}catch (Exception e){
|
|
||||||
//通常是token失效导致的异常返回
|
|
||||||
response.redirect("/oauth/render");
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
response.redirect("/oauth/render");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@GET("/logout")
|
|
||||||
public void logout(HttpResponse response) {
|
|
||||||
if (StpUtil.isLogin()){
|
|
||||||
//可以全局退出
|
|
||||||
SaSession session = StpUtil.getSession();
|
|
||||||
AuthToken authToken = session.get(Data.AuthToken,null);
|
|
||||||
if (authToken != null){
|
|
||||||
AuthResponse revoke = authRequest.revoke(authToken);
|
|
||||||
System.out.println(revoke.getMsg());
|
|
||||||
}
|
|
||||||
//子系统退出
|
|
||||||
StpUtil.logout();
|
|
||||||
}
|
|
||||||
response.redirect("/");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
package com.lktx.center.controller;
|
|
||||||
|
|
||||||
import cn.dev33.satoken.session.SaSession;
|
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
|
||||||
import cn.hserver.core.ioc.annotation.Autowired;
|
|
||||||
import cn.hserver.plugin.web.annotation.Controller;
|
|
||||||
import cn.hserver.plugin.web.annotation.RequestMapping;
|
|
||||||
import cn.hserver.plugin.web.interfaces.HttpResponse;
|
|
||||||
import com.lktx.center.config.Data;
|
|
||||||
import com.lktx.center.config.SsoAuthRequest;
|
|
||||||
import me.zhyd.oauth.model.AuthCallback;
|
|
||||||
import me.zhyd.oauth.model.AuthResponse;
|
|
||||||
import me.zhyd.oauth.model.AuthToken;
|
|
||||||
import me.zhyd.oauth.model.AuthUser;
|
|
||||||
import me.zhyd.oauth.utils.AuthStateUtils;
|
|
||||||
|
|
||||||
@Controller("/oauth")
|
|
||||||
public class RestAuthController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SsoAuthRequest authRequest;
|
|
||||||
|
|
||||||
@RequestMapping("/render")
|
|
||||||
public void renderAuth(HttpResponse response) {
|
|
||||||
String authorize = authRequest.authorize(AuthStateUtils.createState());
|
|
||||||
response.redirect(authorize);
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequestMapping("/callback")
|
|
||||||
public void login(AuthCallback callback,HttpResponse response) {
|
|
||||||
try {
|
|
||||||
AuthResponse<AuthUser> login = authRequest.login(callback);
|
|
||||||
AuthToken token = login.getData().getToken();
|
|
||||||
StpUtil.login(login.getData().getUuid());
|
|
||||||
SaSession session = StpUtil.getSession();
|
|
||||||
session.set(Data.AuthToken, token);
|
|
||||||
response.redirect("/");
|
|
||||||
}catch (Exception e) {
|
|
||||||
response.redirect("/");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
package com.lktx.center.domain.bean;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class RemoteRes<T>{
|
|
||||||
private Integer code;
|
|
||||||
private String msg;
|
|
||||||
private T data;
|
|
||||||
}
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
package com.lktx.center.domain.bean;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import me.zhyd.oauth.utils.UrlBuilder;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
/** app分组 - sso_app */
|
|
||||||
@Data
|
|
||||||
public class SsoApp {
|
|
||||||
/**appId*/
|
|
||||||
private Integer ssoAppId;
|
|
||||||
/**app分组*/
|
|
||||||
private Integer ssoAppGroupId;
|
|
||||||
/**备注*/
|
|
||||||
private String remark;
|
|
||||||
/**创建时间*/
|
|
||||||
private Integer status;
|
|
||||||
/**客户端ID*/
|
|
||||||
private String clientId;
|
|
||||||
/**客户端秘钥*/
|
|
||||||
private String clientSecret;
|
|
||||||
/**app名字*/
|
|
||||||
private String appName;
|
|
||||||
/**app图片地址*/
|
|
||||||
private String appIcon;
|
|
||||||
/**APP类型*/
|
|
||||||
private String appType;
|
|
||||||
private String appUrl;
|
|
||||||
private SsoAppGroup ssoAppGroup;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
package com.lktx.center.domain.bean;
|
|
||||||
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
/** app分组 - sso_app_group */
|
|
||||||
@Data
|
|
||||||
public class SsoAppGroup {
|
|
||||||
/**分组ID*/
|
|
||||||
private Integer ssoAppGroupId;
|
|
||||||
/**分组名字*/
|
|
||||||
private String name;
|
|
||||||
/**备注*/
|
|
||||||
private String remark;
|
|
||||||
/**创建时间*/
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
/**更新时间*/
|
|
||||||
private LocalDateTime updateTime;
|
|
||||||
}
|
|
||||||
@ -1,40 +0,0 @@
|
|||||||
package com.lktx.center.domain.bean;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
/** SSO用户表 - sso_user */
|
|
||||||
@Data
|
|
||||||
public class SsoUser {
|
|
||||||
private Integer ssoUserId;
|
|
||||||
/*组织ID*/
|
|
||||||
private Integer ssoOrganizationId;
|
|
||||||
/**头像*/
|
|
||||||
private String avatar;
|
|
||||||
/**用户姓名*/
|
|
||||||
private String name;
|
|
||||||
/**用户昵称*/
|
|
||||||
private String nickname;
|
|
||||||
/**用户登录名*/
|
|
||||||
private String username;
|
|
||||||
/**手机号*/
|
|
||||||
private String phone;
|
|
||||||
/**邮箱*/
|
|
||||||
private String email;
|
|
||||||
/**密码*/
|
|
||||||
private String password;
|
|
||||||
/**来源*/
|
|
||||||
private String source;
|
|
||||||
/**是否冻结 0 启用 1 禁用*/
|
|
||||||
private Integer locked;
|
|
||||||
/**用户描述*/
|
|
||||||
private String remark;
|
|
||||||
/**是否逻辑删除*/
|
|
||||||
private Integer deleted;
|
|
||||||
/**创建时间*/
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
/**更新时间*/
|
|
||||||
private LocalDateTime updateTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
package com.lktx.center.domain.vo;
|
|
||||||
|
|
||||||
import com.lktx.center.domain.bean.SsoApp;
|
|
||||||
import com.lktx.center.domain.bean.SsoUser;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class SsoUserAppVO {
|
|
||||||
private SsoUser ssoUser;
|
|
||||||
private List<SsoApp> ssoAppList;
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
20
web/pom.xml
Normal file
20
web/pom.xml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.lktx.center</groupId>
|
||||||
|
<artifactId>app-center</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>web</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
</project>
|
||||||
Loading…
x
Reference in New Issue
Block a user