Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec4b0cbb1e | ||
|
|
30fd68d430 | ||
|
|
ec865471cb | ||
|
|
7d454e9c62 |
20
pom.xml
20
pom.xml
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.5</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>springboot-parent</name>
|
||||
<description>杭州铁晟科技有限公司基础依赖</description>
|
||||
@@ -57,55 +57,55 @@
|
||||
<dependency>
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>springboot-db-migration</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>springboot-login</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>springboot-web</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>springboot-util</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>springboot-platform</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>springboot-message</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>springboot-encrypt</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>springboot-annotation</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>springboot-poi</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.5</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-ademo</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.5</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-annotation</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.5</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-db-migration</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.5</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-encrypt</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.5</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-login</artifactId>
|
||||
|
||||
@@ -54,8 +54,8 @@ public class LoginController {
|
||||
@TokenIgnore
|
||||
public void uniqueIndex(UniqueIndexDTO dto, HttpServletResponse response) {
|
||||
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo("unique_index_web",
|
||||
dto.getNo(), "web", dto.getTo(), dto.getInfo()));
|
||||
tieshengLoginConfigurer.onLoginRedirect(tokenBean, dto.getTo(), dto.getExtra(), response);
|
||||
dto.getNo(), "web", dto.getDefaultTo(), dto.getInfo()));
|
||||
tieshengLoginConfigurer.onLoginRedirect(tokenBean, dto.getDefaultTo(), dto.getExtra(), response);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ public class LoginController {
|
||||
@TokenIgnore
|
||||
public ApiResp<String> uniqueIndex(@RequestBody UniqueIndexDTO dto) {
|
||||
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo("unique_index_web",
|
||||
dto.getNo(), "web", dto.getTo(), dto.getInfo()));
|
||||
dto.getNo(), "web", dto.getDefaultTo(), dto.getInfo()));
|
||||
if (tokenBean == null) {
|
||||
throw new ApiException("登录失败");
|
||||
}
|
||||
@@ -118,9 +118,9 @@ public class LoginController {
|
||||
String ddUserId = platformDingConfig.getUserIdByCode(service, dto.getCode());
|
||||
DingUserInfo dingUserInfo = platformDingConfig.topapiV2UserGet(service, ddUserId);
|
||||
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo(dingUserInfo.getAppId(),
|
||||
dingUserInfo.getUserid(), "ding", dto.getTo(),
|
||||
dingUserInfo.getUserid(), "ding", dto.getDefaultTo(),
|
||||
JSON.toJSONString(dingUserInfo)));
|
||||
tieshengLoginConfigurer.onLoginRedirect(tokenBean, dto.getTo(), dto.getExtra(), response);
|
||||
tieshengLoginConfigurer.onLoginRedirect(tokenBean, dto.getDefaultTo(), dto.getExtra(), response);
|
||||
}
|
||||
|
||||
|
||||
@@ -168,8 +168,8 @@ public class LoginController {
|
||||
public void wxmpOauth2(@PathVariable String service, CodeExtraDTO dto, HttpServletResponse response) {
|
||||
WxUserInfo wxUserInfo = platformWxmpConfig.getOAuth2AccessToken(service, dto.getCode());
|
||||
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo(wxUserInfo.getAppId(),
|
||||
wxUserInfo.getOpenid(), "wxmp", dto.getTo(), JSON.toJSONString(wxUserInfo)));
|
||||
tieshengLoginConfigurer.onLoginRedirect(tokenBean, dto.getTo(), dto.getExtra(), response);
|
||||
wxUserInfo.getOpenid(), "wxmp", dto.getDefaultTo(), JSON.toJSONString(wxUserInfo)));
|
||||
tieshengLoginConfigurer.onLoginRedirect(tokenBean, dto.getDefaultTo(), dto.getExtra(), response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
package com.tiesheng.login.pojos;
|
||||
|
||||
public class CodeExtraDTO {
|
||||
public class CodeExtraDTO extends LoginToInfo {
|
||||
|
||||
private String code;
|
||||
private String extra;
|
||||
private String to;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
@@ -26,11 +25,4 @@ public class CodeExtraDTO {
|
||||
this.extra = extra;
|
||||
}
|
||||
|
||||
public String getTo() {
|
||||
return to;
|
||||
}
|
||||
|
||||
public void setTo(String to) {
|
||||
this.to = to;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.tiesheng.login.pojos;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
public class LoginToInfo {
|
||||
|
||||
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
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getTo() {
|
||||
return to;
|
||||
}
|
||||
|
||||
public void setTo(String to) {
|
||||
this.to = to;
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,9 @@ package com.tiesheng.login.pojos;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
public class UniqueIndexDTO {
|
||||
public class UniqueIndexDTO extends LoginToInfo {
|
||||
|
||||
private String no;
|
||||
private String to;
|
||||
private String extra;
|
||||
private String info;
|
||||
|
||||
@@ -21,14 +20,6 @@ public class UniqueIndexDTO {
|
||||
this.no = no;
|
||||
}
|
||||
|
||||
public String getTo() {
|
||||
return to;
|
||||
}
|
||||
|
||||
public void setTo(String to) {
|
||||
this.to = to;
|
||||
}
|
||||
|
||||
public String getExtra() {
|
||||
if (StrUtil.isEmpty(extra)) {
|
||||
extra = "";
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.5</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-message</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.5</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-platform</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.5</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-poi</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.5</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-util</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.5</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-web</artifactId>
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package com.tiesheng.core.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.tiesheng.core.mapper.CorePlatformUniqueMapper;
|
||||
import com.tiesheng.core.pojos.dao.CorePlatformUnique;
|
||||
import com.tiesheng.login.config.token.bean.TokenBean;
|
||||
import com.tiesheng.login.pojos.DoLoginInfo;
|
||||
import com.tiesheng.login.service.TieshengLoginConfigurer;
|
||||
import com.tiesheng.util.config.GlobalConfig;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -23,6 +25,8 @@ public class CorePlatformUniqueService extends TsServiceBase<CorePlatformUniqueM
|
||||
TieshengWebConfigurer tieshengWebConfigurer;
|
||||
@Autowired
|
||||
CoreLogService coreLogService;
|
||||
@Autowired
|
||||
GlobalConfig globalConfig;
|
||||
|
||||
@Override
|
||||
public TokenBean doLogin(DoLoginInfo loginInfo) {
|
||||
@@ -36,7 +40,13 @@ public class CorePlatformUniqueService extends TsServiceBase<CorePlatformUniqueM
|
||||
}
|
||||
platformUnique.setInfo(loginInfo.getInfo());
|
||||
|
||||
TokenBean tokenBean = tieshengWebConfigurer.loginConfigurer().doLogin(platformUnique, loginInfo.getTo());
|
||||
TokenBean tokenBean = null;
|
||||
if (StrUtil.isEmpty(platformUnique.getUserId())) {
|
||||
tokenBean = tieshengWebConfigurer.loginConfigurer().doLogin(platformUnique, loginInfo.getTo());
|
||||
} else {
|
||||
tokenBean = new TokenBean(platformUnique.getUserId(), loginInfo.getTo(), globalConfig.getService());
|
||||
}
|
||||
|
||||
if (tokenBean != null) {
|
||||
platformUnique.setUserId(tokenBean.getId());
|
||||
platformUnique.setIsDeleted(0);
|
||||
|
||||
Reference in New Issue
Block a user