Compare commits

...

4 Commits
0.1.4 ... 0.1.6

Author SHA1 Message Date
曾文豪
e862cdbf43 publish 0.1.6 2023-01-11 16:32:29 +08:00
曾文豪
d6faed4f68 perf:调整授权登录 2023-01-11 16:32:16 +08:00
曾文豪
ec4b0cbb1e publish 0.1.5 2023-01-11 16:25:38 +08:00
曾文豪
30fd68d430 perf:调整授权登录 2023-01-11 16:25:27 +08:00
13 changed files with 27 additions and 51 deletions

20
pom.xml
View File

@@ -6,7 +6,7 @@
<groupId>com.tiesheng</groupId> <groupId>com.tiesheng</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.1.4</version> <version>0.1.6</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>springboot-parent</name> <name>springboot-parent</name>
<description>杭州铁晟科技有限公司基础依赖</description> <description>杭州铁晟科技有限公司基础依赖</description>
@@ -57,55 +57,55 @@
<dependency> <dependency>
<groupId>com.tiesheng</groupId> <groupId>com.tiesheng</groupId>
<artifactId>springboot-db-migration</artifactId> <artifactId>springboot-db-migration</artifactId>
<version>0.1.4</version> <version>0.1.6</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng</groupId> <groupId>com.tiesheng</groupId>
<artifactId>springboot-login</artifactId> <artifactId>springboot-login</artifactId>
<version>0.1.4</version> <version>0.1.6</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng</groupId> <groupId>com.tiesheng</groupId>
<artifactId>springboot-web</artifactId> <artifactId>springboot-web</artifactId>
<version>0.1.4</version> <version>0.1.6</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng</groupId> <groupId>com.tiesheng</groupId>
<artifactId>springboot-util</artifactId> <artifactId>springboot-util</artifactId>
<version>0.1.4</version> <version>0.1.6</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng</groupId> <groupId>com.tiesheng</groupId>
<artifactId>springboot-platform</artifactId> <artifactId>springboot-platform</artifactId>
<version>0.1.4</version> <version>0.1.6</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng</groupId> <groupId>com.tiesheng</groupId>
<artifactId>springboot-message</artifactId> <artifactId>springboot-message</artifactId>
<version>0.1.4</version> <version>0.1.6</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng</groupId> <groupId>com.tiesheng</groupId>
<artifactId>springboot-encrypt</artifactId> <artifactId>springboot-encrypt</artifactId>
<version>0.1.4</version> <version>0.1.6</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng</groupId> <groupId>com.tiesheng</groupId>
<artifactId>springboot-annotation</artifactId> <artifactId>springboot-annotation</artifactId>
<version>0.1.4</version> <version>0.1.6</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng</groupId> <groupId>com.tiesheng</groupId>
<artifactId>springboot-poi</artifactId> <artifactId>springboot-poi</artifactId>
<version>0.1.4</version> <version>0.1.6</version>
</dependency> </dependency>
<dependency> <dependency>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng</groupId> <groupId>com.tiesheng</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.1.4</version> <version>0.1.6</version>
</parent> </parent>
<artifactId>springboot-ademo</artifactId> <artifactId>springboot-ademo</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng</groupId> <groupId>com.tiesheng</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.1.4</version> <version>0.1.6</version>
</parent> </parent>
<artifactId>springboot-annotation</artifactId> <artifactId>springboot-annotation</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng</groupId> <groupId>com.tiesheng</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.1.4</version> <version>0.1.6</version>
</parent> </parent>
<artifactId>springboot-db-migration</artifactId> <artifactId>springboot-db-migration</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng</groupId> <groupId>com.tiesheng</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.1.4</version> <version>0.1.6</version>
</parent> </parent>
<artifactId>springboot-encrypt</artifactId> <artifactId>springboot-encrypt</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng</groupId> <groupId>com.tiesheng</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.1.4</version> <version>0.1.6</version>
</parent> </parent>
<artifactId>springboot-login</artifactId> <artifactId>springboot-login</artifactId>

View File

@@ -54,8 +54,8 @@ public class LoginController {
@TokenIgnore @TokenIgnore
public void uniqueIndex(UniqueIndexDTO dto, HttpServletResponse response) { public void uniqueIndex(UniqueIndexDTO dto, HttpServletResponse response) {
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo("unique_index_web", TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo("unique_index_web",
dto.getNo(), "web", dto.getDefaultTo(), dto.getInfo())); dto.getNo(), "web", dto.getTo(), dto.getInfo()));
tieshengLoginConfigurer.onLoginRedirect(tokenBean, dto.getDefaultTo(), dto.getExtra(), response); tieshengLoginConfigurer.onLoginRedirect(tokenBean, dto.getTo(), dto.getExtra(), response);
} }
@@ -69,7 +69,7 @@ public class LoginController {
@TokenIgnore @TokenIgnore
public ApiResp<String> uniqueIndex(@RequestBody UniqueIndexDTO dto) { public ApiResp<String> uniqueIndex(@RequestBody UniqueIndexDTO dto) {
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo("unique_index_web", TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo("unique_index_web",
dto.getNo(), "web", dto.getDefaultTo(), dto.getInfo())); dto.getNo(), "web", dto.getTo(), dto.getInfo()));
if (tokenBean == null) { if (tokenBean == null) {
throw new ApiException("登录失败"); throw new ApiException("登录失败");
} }
@@ -118,9 +118,9 @@ public class LoginController {
String ddUserId = platformDingConfig.getUserIdByCode(service, dto.getCode()); String ddUserId = platformDingConfig.getUserIdByCode(service, dto.getCode());
DingUserInfo dingUserInfo = platformDingConfig.topapiV2UserGet(service, ddUserId); DingUserInfo dingUserInfo = platformDingConfig.topapiV2UserGet(service, ddUserId);
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo(dingUserInfo.getAppId(), TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo(dingUserInfo.getAppId(),
dingUserInfo.getUserid(), "ding", dto.getDefaultTo(), dingUserInfo.getUserid(), "ding", dto.getTo(),
JSON.toJSONString(dingUserInfo))); JSON.toJSONString(dingUserInfo)));
tieshengLoginConfigurer.onLoginRedirect(tokenBean, dto.getDefaultTo(), dto.getExtra(), response); tieshengLoginConfigurer.onLoginRedirect(tokenBean, dto.getTo(), dto.getExtra(), response);
} }
@@ -168,8 +168,8 @@ public class LoginController {
public void wxmpOauth2(@PathVariable String service, CodeExtraDTO dto, HttpServletResponse response) { public void wxmpOauth2(@PathVariable String service, CodeExtraDTO dto, HttpServletResponse response) {
WxUserInfo wxUserInfo = platformWxmpConfig.getOAuth2AccessToken(service, dto.getCode()); WxUserInfo wxUserInfo = platformWxmpConfig.getOAuth2AccessToken(service, dto.getCode());
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo(wxUserInfo.getAppId(), TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo(wxUserInfo.getAppId(),
wxUserInfo.getOpenid(), "wxmp", dto.getDefaultTo(), JSON.toJSONString(wxUserInfo))); wxUserInfo.getOpenid(), "wxmp", dto.getTo(), JSON.toJSONString(wxUserInfo)));
tieshengLoginConfigurer.onLoginRedirect(tokenBean, dto.getDefaultTo(), dto.getExtra(), response); tieshengLoginConfigurer.onLoginRedirect(tokenBean, dto.getTo(), dto.getExtra(), response);
} }

View File

@@ -1,33 +1,9 @@
package com.tiesheng.login.pojos; package com.tiesheng.login.pojos;
import cn.hutool.core.util.StrUtil;
public class LoginToInfo { public class LoginToInfo {
private String to; private String to;
/**
* 获取默认的去往目的地
*
* @param def
* @return
*/
public String getDefaultTo(String def) {
if (StrUtil.isEmpty(getTo())) {
return def;
}
return getTo();
}
/**
* 获取默认的去往目的地
*
* @return
*/
public String getDefaultTo() {
return getDefaultTo("mobile");
}
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// setter\getter // setter\getter
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng</groupId> <groupId>com.tiesheng</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.1.4</version> <version>0.1.6</version>
</parent> </parent>
<artifactId>springboot-message</artifactId> <artifactId>springboot-message</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng</groupId> <groupId>com.tiesheng</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.1.4</version> <version>0.1.6</version>
</parent> </parent>
<artifactId>springboot-platform</artifactId> <artifactId>springboot-platform</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng</groupId> <groupId>com.tiesheng</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.1.4</version> <version>0.1.6</version>
</parent> </parent>
<artifactId>springboot-poi</artifactId> <artifactId>springboot-poi</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng</groupId> <groupId>com.tiesheng</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.1.4</version> <version>0.1.6</version>
</parent> </parent>
<artifactId>springboot-util</artifactId> <artifactId>springboot-util</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng</groupId> <groupId>com.tiesheng</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>0.1.4</version> <version>0.1.6</version>
</parent> </parent>
<artifactId>springboot-web</artifactId> <artifactId>springboot-web</artifactId>